From 03822d52aa6f84114541a6ddcec338313e7d12a0 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 12 Oct 2020 12:31:51 -0400 Subject: [PATCH 01/12] Refactor RegisterQueryServices -> RegisterServices (#7518) * Refactor RegisterQueryServices -> RegisterServices * Fix tests --- simapp/app.go | 2 +- tests/mocks/types_module_module.go | 26 +++++++++++++------------- types/module/configurator.go | 27 +++++++++++++++++++++++++++ types/module/module.go | 15 +++++++-------- types/module/module_test.go | 11 ++++++----- 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, 84 insertions(+), 71 deletions(-) create mode 100644 types/module/configurator.go diff --git a/simapp/app.go b/simapp/app.go index 9ba94183cd65..6f26547a4f8d 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -358,7 +358,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(module.NewConfigurator(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..efa83607de14 --- /dev/null +++ b/types/module/configurator.go @@ -0,0 +1,27 @@ +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 +} + +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 d02b9b25682a..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" @@ -173,8 +172,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) @@ -207,8 +206,8 @@ 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. -func (gam GenesisOnlyAppModule) RegisterQueryService(grpc.Server) {} +// RegisterServices registers all services. +func (gam GenesisOnlyAppModule) RegisterServices(Configurator) {} // BeginBlock returns an empty module begin-block func (gam GenesisOnlyAppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {} @@ -288,10 +287,10 @@ 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(cfg Configurator) { 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..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().RegisterQueryService(queryRouter).Times(1) - mockAppModule2.EXPECT().RegisterQueryService(queryRouter).Times(1) + cfg := module.NewConfigurator(queryRouter) + mockAppModule1.EXPECT().RegisterServices(cfg).Times(1) + mockAppModule2.EXPECT().RegisterServices(cfg).Times(1) - mm.RegisterQueryServices(queryRouter) + mm.RegisterServices(cfg) } 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..89ed2a4dd468 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(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 b60e6354c18fff84def4527a06064d5d106cc177 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Thu, 15 Oct 2020 15:07:59 +0200 Subject: [PATCH 02/12] Add ADR 031 BaseApp and codec infrastructure (#7519) * Refactor RegisterQueryServices -> RegisterServices * Cleaner proto files * Fix tests * Add MsgServer * Fix lint * Remove MsgServer from configurator for now * Remove useless file * Fix build * typo * Add router * Fix test * WIP * Add router * Remove test helper * Add beginning of test * Move test to simapp? * ServiceMsg implement sdk.Msg * Add handler by MsgServiceRouter * Correct signature * Add full test * use TxEncoder * Update baseapp/msg_service_router.go Co-authored-by: Aaron Craelius * Push changes * WIP on ServiceMsg unpacking * Make TestMsgService test pass * Fix tests * Tidying up * Tidying up * Tidying up * Add JSON test * Add comments * Tidying * Lint * Register MsgRequest interface * Rename * Fix tests * RegisterCustomTypeURL * Add changelog entries * Put in features * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Update baseapp/msg_service_router.go Co-authored-by: Aleksandr Bezobchuk * Address review comments * Address nit * Fix lint * Update codec/types/interface_registry.go Co-authored-by: Marie Gauthier * godoc Co-authored-by: Aaron Craelius Co-authored-by: Aaron Craelius Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Marie Gauthier --- CHANGELOG.md | 15 +- baseapp/abci.go | 2 +- baseapp/baseapp.go | 77 +- baseapp/baseapp_test.go | 6 +- baseapp/grpcrouter_helpers.go | 11 +- baseapp/grpcrouter_test.go | 4 +- baseapp/msg_service_router.go | 94 + baseapp/msg_service_router_test.go | 74 + baseapp/options.go | 8 + client/context_test.go | 2 +- client/grpc_query_test.go | 2 +- codec/json.go | 4 +- codec/proto_codec.go | 21 +- codec/types/interface_registry.go | 57 +- codec/types/types_test.go | 66 +- codec/unknownproto/benchmarks_test.go | 4 +- codec/unknownproto/unknown_fields.go | 51 +- codec/unknownproto/unknown_fields_test.go | 10 +- scripts/protocgen.sh | 2 +- server/grpc/server_test.go | 2 +- simapp/app.go | 5 +- std/codec.go | 3 - .../testdata/{test_helper.go => codec.go} | 9 +- .../{test_service.go => grpc_query.go} | 12 +- testutil/testdata/msg_server.go | 16 + testutil/testdata/query.pb.go | 1371 ++ testutil/testdata/query.proto | 39 + testutil/testdata/testdata.pb.go | 1412 ++ testutil/testdata/testdata.proto | 37 + testutil/testdata/{test_tx.go => tx.go} | 12 + testutil/testdata/tx.pb.go | 764 ++ testutil/testdata/tx.proto | 28 + .../{proto.pb.go => unknonwnproto.pb.go} | 10943 ++++++---------- .../{proto.proto => unknonwnproto.proto} | 66 - types/codec.go | 3 + types/service_msg.go | 58 + types/tx/types.go | 38 +- x/auth/ante/testutil_test.go | 3 +- x/auth/client/tx_test.go | 2 +- x/auth/tx/builder.go | 23 +- x/auth/tx/config.go | 2 +- x/auth/tx/decoder.go | 6 +- x/auth/tx/encode_decode_test.go | 5 +- x/auth/tx/encoder.go | 6 +- x/auth/tx/sigs.go | 2 +- x/auth/types/codec.go | 2 +- x/auth/vesting/types/codec.go | 2 + x/staking/types/staking.pb.go | 1142 +- 48 files changed, 8971 insertions(+), 7552 deletions(-) create mode 100644 baseapp/msg_service_router.go create mode 100644 baseapp/msg_service_router_test.go rename testutil/testdata/{test_helper.go => codec.go} (83%) rename testutil/testdata/{test_service.go => grpc_query.go} (72%) create mode 100644 testutil/testdata/msg_server.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 rename testutil/testdata/{test_tx.go => tx.go} (81%) create mode 100644 testutil/testdata/tx.pb.go create mode 100644 testutil/testdata/tx.proto rename testutil/testdata/{proto.pb.go => unknonwnproto.pb.go} (70%) rename testutil/testdata/{proto.proto => unknonwnproto.proto} (87%) create mode 100644 types/service_msg.go diff --git a/CHANGELOG.md b/CHANGELOG.md index a53ab03cd4e3..2a2af1cb5ff4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,20 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog -## v0.40.0-rc0 - 2020-10-13 +## [Unreleased] + +## v0.40.0-rc1 - 2020-10-13 + +### 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. + +## [v0.40.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0-rc0) - 2020-10-13 v0.40.0, known as the Stargate release of the Cosmos SDK, is one of the largest releases of the Cosmos SDK since launch. Please read through this changelog and [release notes](./RELEASE_NOTES.md) to make sure you are aware of any relevant breaking changes. 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 23a9d1dd8d56..f215868654df 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -13,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" @@ -45,15 +46,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 - 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 @@ -136,16 +139,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 { @@ -176,6 +180,9 @@ func (app *BaseApp) Logger() log.Logger { return app.logger } +// 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. func (app *BaseApp) MountStores(keys ...sdk.StoreKey) { @@ -682,20 +689,38 @@ 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 + msgResult *sdk.Result + msgFqName string + err error + ) + + if svcMsg, ok := msg.(sdk.ServiceMsg); ok { + 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", msgFqName, i) + } + msgResult, err = handler(ctx, svcMsg.Request) + } else { + // legacy sdk.Msg routing + msgRoute := msg.Route() + 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) + } - 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, msgFqName)), } msgEvents = msgEvents.AppendEvents(msgResult.GetEvents()) 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_helpers.go b/baseapp/grpcrouter_helpers.go index 5d4048e0ed1f..bd7d498e7aee 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,11 @@ type QueryServiceTestHelper struct { ctx sdk.Context } +var ( + _ gogogrpc.Server = &QueryServiceTestHelper{} + _ 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 +66,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/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/baseapp/msg_service_router.go b/baseapp/msg_service_router.go new file mode 100644 index 000000000000..efc108881bda --- /dev/null +++ b/baseapp/msg_service_router.go @@ -0,0 +1,94 @@ +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" +) + +// MsgServiceRouter routes fully-qualified Msg 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 Msg service message. +type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error) + +// Handler returns the MsgServiceHandler for a given query route path or nil +// if not found. +func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler { + return msr.routes[methodName] +} + +// 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 + + // 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.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 + }) + + 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. + 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{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { + goCtx = context.WithValue(goCtx, sdk.SdkContextKey, ctx) + return handler(goCtx, req) + }) + if err != nil { + return nil, err + } + + resMsg, ok := res.(proto.Message) + if !ok { + return nil, fmt.Errorf("can't proto encode %T", resMsg) + } + + return sdk.WrapServiceResult(ctx, resMsg, err) + } + } +} + +// 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_test.go b/baseapp/msg_service_router_test.go new file mode 100644 index 000000000000..f0f9be57b43f --- /dev/null +++ b/baseapp/msg_service_router_test.go @@ -0,0 +1,74 @@ +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" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" + + "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) { + priv, _, _ := testdata.KeyTestPubAddr() + 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.MsgServerImpl{}, + ) + _ = 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()) + 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. + 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) + + // 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.TxEncoder()(txBuilder.GetTx()) + require.NoError(t, err) + res := app.DeliverTx(abci.RequestDeliverTx{Tx: txBytes}) + require.Equal(t, abci.CodeTypeOK, res.Code, "res=%+v", res) +} diff --git a/baseapp/options.go b/baseapp/options.go index 026433ae5bed..008af9a18535 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -6,6 +6,7 @@ import ( 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" @@ -221,3 +222,10 @@ 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) + app.msgServiceRouter.SetInterfaceRegistry(registry) +} 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/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/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 8bdb8168f5d5..966e935692b4 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" ) @@ -24,6 +26,7 @@ type AnyUnpacker interface { // 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 +46,17 @@ type InterfaceRegistry interface { // registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) RegisterImplementations(iface interface{}, impls ...proto.Message) + // 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{}, typeURL string, impl proto.Message) + // ListAllInterfaces list the type URLs of all registered interfaces. ListAllInterfaces() []string @@ -78,6 +92,7 @@ type UnpackInterfacesMessage interface { type interfaceRegistry struct { interfaceNames map[string]reflect.Type interfaceImpls map[reflect.Type]interfaceMap + typeURLMap map[string]reflect.Type } type interfaceMap = map[string]reflect.Type @@ -87,6 +102,7 @@ func NewInterfaceRegistry() InterfaceRegistry { return &interfaceRegistry{ interfaceNames: map[string]reflect.Type{}, interfaceImpls: map[reflect.Type]interfaceMap{}, + typeURLMap: map[string]reflect.Type{}, } } @@ -100,21 +116,31 @@ 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) RegisterCustomTypeURL(iface interface{}, typeURL string, impl proto.Message) { + registry.registerImpl(iface, typeURL, impl) +} + +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)) - } - - imap["/"+proto.MessageName(impl)] = implType + implType := reflect.TypeOf(impl) + if !implType.AssignableTo(ityp) { + panic(fmt.Errorf("type %T doesn't actually implement interface %+v", impl, ityp)) } + imap[typeURL] = implType + registry.typeURLMap[typeURL] = implType + registry.interfaceImpls[ityp] = imap } @@ -198,6 +224,23 @@ 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 { + 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 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/codec/types/types_test.go b/codec/types/types_test.go index 0a14ed3e619f..5e2a0f7f77ee 100644 --- a/codec/types/types_test.go +++ b/codec/types/types_test.go @@ -1,15 +1,20 @@ package types_test import ( + "context" + "fmt" "strings" "testing" + "github.com/gogo/protobuf/grpc" "github.com/gogo/protobuf/jsonpb" - - "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/gogo/protobuf/proto" + grpc2 "google.golang.org/grpc" "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" ) @@ -153,3 +158,60 @@ func TestAny_ProtoJSON(t *testing.T) { require.NoError(t, err) 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 +} + +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) + } + + // registry the method request type with the interface registry + t.interfaceRegistry.RegisterCustomTypeURL((*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) + + // marshal JSON + 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)) + + // unmarshal JSON + var any2 types.Any + err = cdc.UnmarshalJSON(bz, &any2) + require.NoError(t, err) + require.Equal(t, anyPacker.any, any2) +} 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 4faaca0b858e..b2e7a0e0693b 100644 --- a/codec/unknownproto/unknown_fields.go +++ b/codec/unknownproto/unknown_fields.go @@ -7,8 +7,10 @@ import ( "fmt" "io/ioutil" "reflect" + "strings" "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,9 @@ 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) +// 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 } @@ -34,7 +37,8 @@ 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) { +// 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 } @@ -115,9 +119,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 +136,18 @@ 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 + } } - 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 @@ -401,3 +412,23 @@ 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 + 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/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 6f26547a4f8d..7e407af6b8fe 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -113,6 +113,7 @@ var ( upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, ) // module account permissions @@ -201,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( @@ -361,7 +362,7 @@ func NewSimApp( app.mm.RegisterServices(module.NewConfigurator(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/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/testutil/testdata/test_helper.go b/testutil/testdata/codec.go similarity index 83% rename from testutil/testdata/test_helper.go rename to testutil/testdata/codec.go index 8952ebbe07b6..54f63d03c2bc 100644 --- a/testutil/testdata/test_helper.go +++ b/testutil/testdata/codec.go @@ -4,10 +4,18 @@ import ( amino "github.com/tendermint/go-amino" "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/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 +30,6 @@ func NewTestInterfaceRegistry() types.InterfaceRegistry { (*HasHasAnimalI)(nil), &HasHasAnimal{}, ) - return registry } func NewTestAmino() *amino.Codec { 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..6e2b64152995 100644 --- a/testutil/testdata/test_service.go +++ b/testutil/testdata/grpc_query.go @@ -9,9 +9,11 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" ) -type TestServiceImpl struct{} +type QueryImpl struct{} -func (e TestServiceImpl) TestAny(_ context.Context, request *TestAnyRequest) (*TestAnyResponse, error) { +var _ QueryServer = QueryImpl{} + +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,17 +30,15 @@ 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 _ types.UnpackInterfacesMessage = &TestAnyRequest{} func (m *TestAnyRequest) UnpackInterfaces(unpacker types.AnyUnpacker) error { diff --git a/testutil/testdata/msg_server.go b/testutil/testdata/msg_server.go new file mode 100644 index 000000000000..3b434c68c86c --- /dev/null +++ b/testutil/testdata/msg_server.go @@ -0,0 +1,16 @@ +package testdata + +import ( + "context" +) + +type MsgServerImpl struct{} + +var _ MsgServer = MsgServerImpl{} + +// CreateDog implements the MsgServer interface. +func (m MsgServerImpl) CreateDog(_ context.Context, msg *MsgCreateDog) (*MsgCreateDogResponse, error) { + return &MsgCreateDogResponse{ + Name: msg.Dog.Name, + }, nil +} 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, 0x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x85, 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/test_tx.go b/testutil/testdata/tx.go similarity index 81% rename from testutil/testdata/test_tx.go rename to testutil/testdata/tx.go index 72f8d0f00ac0..09e1e365f1ca 100644 --- a/testutil/testdata/test_tx.go +++ b/testutil/testdata/tx.go @@ -65,3 +65,15 @@ func (msg *TestMsg) GetSigners() []sdk.AccAddress { return addrs } func (msg *TestMsg) ValidateBasic() error { return nil } + +var _ sdk.MsgRequest = &MsgCreateDog{} + +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/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/proto.pb.go b/testutil/testdata/unknonwnproto.pb.go similarity index 70% rename from testutil/testdata/proto.pb.go rename to testutil/testdata/unknonwnproto.pb.go index 929f0d442333..b8a5425e873a 100644 --- a/testutil/testdata/proto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -1,20 +1,15 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: proto.proto +// source: unknonwnproto.proto 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,26 +57,28 @@ func (x Customer2_City) String() string { } func (Customer2_City) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{14, 0} + return fileDescriptor_448ea787339d1228, []int{1, 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"` +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 *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 *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 *Dog) XXX_Unmarshal(b []byte) error { +func (m *Customer1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Customer1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Dog.Marshal(b, m, deterministic) + return xxx_messageInfo_Customer1.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -91,49 +88,68 @@ func (m *Dog) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Dog) XXX_Merge(src proto.Message) { - xxx_messageInfo_Dog.Merge(m, src) +func (m *Customer1) XXX_Merge(src proto.Message) { + xxx_messageInfo_Customer1.Merge(m, src) } -func (m *Dog) XXX_Size() int { +func (m *Customer1) XXX_Size() int { return m.Size() } -func (m *Dog) XXX_DiscardUnknown() { - xxx_messageInfo_Dog.DiscardUnknown(m) +func (m *Customer1) XXX_DiscardUnknown() { + xxx_messageInfo_Customer1.DiscardUnknown(m) } -var xxx_messageInfo_Dog proto.InternalMessageInfo +var xxx_messageInfo_Customer1 proto.InternalMessageInfo -func (m *Dog) GetSize_() string { +func (m *Customer1) GetId() int32 { if m != nil { - return m.Size_ + return m.Id } - return "" + return 0 } -func (m *Dog) GetName() string { +func (m *Customer1) 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 *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 *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 *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 *Cat) XXX_Unmarshal(b []byte) error { +func (m *Customer2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Customer2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Cat.Marshal(b, m, deterministic) + return xxx_messageInfo_Customer2.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -143,100 +159,84 @@ func (m *Cat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Cat) XXX_Merge(src proto.Message) { - xxx_messageInfo_Cat.Merge(m, src) +func (m *Customer2) XXX_Merge(src proto.Message) { + xxx_messageInfo_Customer2.Merge(m, src) } -func (m *Cat) XXX_Size() int { +func (m *Customer2) XXX_Size() int { return m.Size() } -func (m *Cat) XXX_DiscardUnknown() { - xxx_messageInfo_Cat.DiscardUnknown(m) +func (m *Customer2) XXX_DiscardUnknown() { + xxx_messageInfo_Customer2.DiscardUnknown(m) } -var xxx_messageInfo_Cat proto.InternalMessageInfo +var xxx_messageInfo_Customer2 proto.InternalMessageInfo -func (m *Cat) GetMoniker() string { +func (m *Customer2) GetId() int32 { if m != nil { - return m.Moniker + return m.Id } - return "" + return 0 } -func (m *Cat) GetLives() int32 { +func (m *Customer2) GetIndustry() int32 { if m != nil { - return m.Lives + return m.Industry } 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 *Customer2) GetName() string { + if m != nil { + return m.Name + } + return "" } -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 *Customer2) GetFewer() float32 { + if m != nil { + return m.Fewer } -} -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) + return 0 } -var xxx_messageInfo_HasAnimal proto.InternalMessageInfo +func (m *Customer2) GetReserved() int64 { + if m != nil { + return m.Reserved + } + return 0 +} -func (m *HasAnimal) GetAnimal() *types.Any { +func (m *Customer2) GetCity() Customer2_City { if m != nil { - return m.Animal + return m.City } - return nil + return Customer2_Laos } -func (m *HasAnimal) GetX() int64 { +func (m *Customer2) GetMiscellaneous() *types.Any { if m != nil { - return m.X + return m.Miscellaneous } - return 0 + return nil } -type HasHasAnimal struct { - HasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` +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 *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 *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 *HasHasAnimal) XXX_Unmarshal(b []byte) error { +func (m *Nested4A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested4A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HasHasAnimal.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested4A.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -246,41 +246,51 @@ func (m *HasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *HasHasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasHasAnimal.Merge(m, src) +func (m *Nested4A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested4A.Merge(m, src) } -func (m *HasHasAnimal) XXX_Size() int { +func (m *Nested4A) XXX_Size() int { return m.Size() } -func (m *HasHasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasHasAnimal.DiscardUnknown(m) +func (m *Nested4A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested4A.DiscardUnknown(m) } -var xxx_messageInfo_HasHasAnimal proto.InternalMessageInfo +var xxx_messageInfo_Nested4A proto.InternalMessageInfo -func (m *HasHasAnimal) GetHasAnimal() *types.Any { +func (m *Nested4A) GetId() int32 { if m != nil { - return m.HasAnimal + return m.Id } - return nil + return 0 +} + +func (m *Nested4A) GetName() string { + if m != nil { + return m.Name + } + return "" } -type HasHasHasAnimal struct { - HasHasAnimal *types.Any `protobuf:"bytes,1,opt,name=has_has_animal,json=hasHasAnimal,proto3" json:"has_has_animal,omitempty"` +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 *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 *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 *HasHasHasAnimal) XXX_Unmarshal(b []byte) error { +func (m *Nested3A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested3A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HasHasHasAnimal.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested3A.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -290,85 +300,64 @@ func (m *HasHasHasAnimal) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *HasHasHasAnimal) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasHasHasAnimal.Merge(m, src) +func (m *Nested3A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested3A.Merge(m, src) } -func (m *HasHasHasAnimal) XXX_Size() int { +func (m *Nested3A) XXX_Size() int { return m.Size() } -func (m *HasHasHasAnimal) XXX_DiscardUnknown() { - xxx_messageInfo_HasHasHasAnimal.DiscardUnknown(m) +func (m *Nested3A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested3A.DiscardUnknown(m) } -var xxx_messageInfo_HasHasHasAnimal proto.InternalMessageInfo +var xxx_messageInfo_Nested3A proto.InternalMessageInfo -func (m *HasHasHasAnimal) GetHasHasAnimal() *types.Any { +func (m *Nested3A) GetId() int32 { if m != nil { - return m.HasHasAnimal + return m.Id } - return nil + return 0 } -type EchoRequest struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +func (m *Nested3A) GetName() string { + if m != nil { + return m.Name + } + return "" } -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 *Nested3A) GetA4() []*Nested4A { + if m != nil { + return m.A4 } -} -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) + return nil } -var xxx_messageInfo_EchoRequest proto.InternalMessageInfo - -func (m *EchoRequest) GetMessage() string { +func (m *Nested3A) GetIndex() map[int64]*Nested4A { if m != nil { - return m.Message + return m.Index } - return "" + return nil } -type EchoResponse struct { - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +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 *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 *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 *EchoResponse) XXX_Unmarshal(b []byte) error { +func (m *Nested2A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested2A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EchoResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested2A.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -378,41 +367,56 @@ func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *EchoResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_EchoResponse.Merge(m, src) +func (m *Nested2A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested2A.Merge(m, src) } -func (m *EchoResponse) XXX_Size() int { +func (m *Nested2A) XXX_Size() int { return m.Size() } -func (m *EchoResponse) XXX_DiscardUnknown() { - xxx_messageInfo_EchoResponse.DiscardUnknown(m) +func (m *Nested2A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested2A.DiscardUnknown(m) } -var xxx_messageInfo_EchoResponse proto.InternalMessageInfo +var xxx_messageInfo_Nested2A proto.InternalMessageInfo + +func (m *Nested2A) GetId() int32 { + if m != nil { + return m.Id + } + return 0 +} -func (m *EchoResponse) GetMessage() string { +func (m *Nested2A) GetName() string { if m != nil { - return m.Message + return m.Name } return "" } -type SayHelloRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +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 *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 *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 *SayHelloRequest) XXX_Unmarshal(b []byte) error { +func (m *Nested1A) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested1A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SayHelloRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested1A.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -422,41 +426,50 @@ func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *SayHelloRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SayHelloRequest.Merge(m, src) +func (m *Nested1A) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested1A.Merge(m, src) } -func (m *SayHelloRequest) XXX_Size() int { +func (m *Nested1A) XXX_Size() int { return m.Size() } -func (m *SayHelloRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SayHelloRequest.DiscardUnknown(m) +func (m *Nested1A) XXX_DiscardUnknown() { + xxx_messageInfo_Nested1A.DiscardUnknown(m) } -var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo +var xxx_messageInfo_Nested1A proto.InternalMessageInfo -func (m *SayHelloRequest) GetName() string { +func (m *Nested1A) GetId() int32 { if m != nil { - return m.Name + return m.Id } - return "" + return 0 +} + +func (m *Nested1A) GetNested() *Nested2A { + if m != nil { + return m.Nested + } + return nil } -type SayHelloResponse struct { - Greeting string `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"` +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 *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 *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 *SayHelloResponse) XXX_Unmarshal(b []byte) error { +func (m *Nested4B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested4B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SayHelloResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested4B.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -466,41 +479,58 @@ func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *SayHelloResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SayHelloResponse.Merge(m, src) +func (m *Nested4B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested4B.Merge(m, src) } -func (m *SayHelloResponse) XXX_Size() int { +func (m *Nested4B) XXX_Size() int { return m.Size() } -func (m *SayHelloResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SayHelloResponse.DiscardUnknown(m) +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 } -var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo +func (m *Nested4B) GetAge() int32 { + if m != nil { + return m.Age + } + return 0 +} -func (m *SayHelloResponse) GetGreeting() string { +func (m *Nested4B) GetName() string { if m != nil { - return m.Greeting + return m.Name } return "" } -type TestAnyRequest struct { - AnyAnimal *types.Any `protobuf:"bytes,1,opt,name=any_animal,json=anyAnimal,proto3" json:"any_animal,omitempty"` +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 *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 *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 *TestAnyRequest) XXX_Unmarshal(b []byte) error { +func (m *Nested3B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested3B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestAnyRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested3B.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -510,86 +540,65 @@ func (m *TestAnyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *TestAnyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestAnyRequest.Merge(m, src) +func (m *Nested3B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested3B.Merge(m, src) } -func (m *TestAnyRequest) XXX_Size() int { +func (m *Nested3B) XXX_Size() int { return m.Size() } -func (m *TestAnyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TestAnyRequest.DiscardUnknown(m) +func (m *Nested3B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested3B.DiscardUnknown(m) } -var xxx_messageInfo_TestAnyRequest proto.InternalMessageInfo +var xxx_messageInfo_Nested3B proto.InternalMessageInfo -func (m *TestAnyRequest) GetAnyAnimal() *types.Any { +func (m *Nested3B) GetId() int32 { if m != nil { - return m.AnyAnimal + return m.Id } - return nil + return 0 } -type TestAnyResponse struct { - HasAnimal *HasAnimal `protobuf:"bytes,1,opt,name=has_animal,json=hasAnimal,proto3" json:"has_animal,omitempty"` +func (m *Nested3B) GetAge() int32 { + if m != nil { + return m.Age + } + return 0 } -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 *Nested3B) GetName() string { + if m != nil { + return m.Name } + return "" } -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 { +func (m *Nested3B) GetB4() []*Nested4B { if m != nil { - return m.HasAnimal + return m.B4 } return nil } -// msg type for testing -type TestMsg struct { - Signers []string `protobuf:"bytes,1,rep,name=signers,proto3" json:"signers,omitempty"` +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 *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} +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 *TestMsg) XXX_Unmarshal(b []byte) error { +func (m *Nested2B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested2B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestMsg.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested2B.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -599,91 +608,64 @@ func (m *TestMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TestMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestMsg.Merge(m, src) +func (m *Nested2B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested2B.Merge(m, src) } -func (m *TestMsg) XXX_Size() int { +func (m *Nested2B) XXX_Size() int { return m.Size() } -func (m *TestMsg) XXX_DiscardUnknown() { - xxx_messageInfo_TestMsg.DiscardUnknown(m) +func (m *Nested2B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested2B.DiscardUnknown(m) } -var xxx_messageInfo_TestMsg proto.InternalMessageInfo +var xxx_messageInfo_Nested2B 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 *Nested2B) GetId() int32 { + if m != nil { + return m.Id + } + return 0 } -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} -} -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 *Nested2B) GetFee() float64 { + if m != nil { + return m.Fee } -} -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) + return 0 } -var xxx_messageInfo_BadMultiSignature proto.InternalMessageInfo - -func (m *BadMultiSignature) GetSignatures() [][]byte { +func (m *Nested2B) GetNested() *Nested3B { if m != nil { - return m.Signatures + return m.Nested } return nil } -func (m *BadMultiSignature) GetMaliciousField() []byte { +func (m *Nested2B) GetRoute() string { if m != nil { - return m.MaliciousField + return m.Route } - return nil + return "" } -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"` +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 *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} +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 *Customer1) XXX_Unmarshal(b []byte) error { +func (m *Nested1B) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Customer1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Nested1B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Customer1.Marshal(b, m, deterministic) + return xxx_messageInfo_Nested1B.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -693,68 +675,64 @@ func (m *Customer1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Customer1) XXX_Merge(src proto.Message) { - xxx_messageInfo_Customer1.Merge(m, src) +func (m *Nested1B) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nested1B.Merge(m, src) } -func (m *Customer1) XXX_Size() int { +func (m *Nested1B) XXX_Size() int { return m.Size() } -func (m *Customer1) XXX_DiscardUnknown() { - xxx_messageInfo_Customer1.DiscardUnknown(m) +func (m *Nested1B) XXX_DiscardUnknown() { + xxx_messageInfo_Nested1B.DiscardUnknown(m) } -var xxx_messageInfo_Customer1 proto.InternalMessageInfo +var xxx_messageInfo_Nested1B proto.InternalMessageInfo -func (m *Customer1) GetId() int32 { +func (m *Nested1B) GetId() int32 { if m != nil { return m.Id } return 0 } -func (m *Customer1) GetName() string { +func (m *Nested1B) GetNested() *Nested2B { if m != nil { - return m.Name + return m.Nested } - return "" + return nil } -func (m *Customer1) GetSubscriptionFee() float32 { +func (m *Nested1B) GetAge() int32 { if m != nil { - return m.SubscriptionFee + return m.Age } 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"` +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 *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} +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 *Customer2) XXX_Unmarshal(b []byte) error { +func (m *Customer3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Customer2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Customer3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Customer2.Marshal(b, m, deterministic) + return xxx_messageInfo_Customer3.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -764,84 +742,134 @@ func (m *Customer2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Customer2) XXX_Merge(src proto.Message) { - xxx_messageInfo_Customer2.Merge(m, src) +func (m *Customer3) XXX_Merge(src proto.Message) { + xxx_messageInfo_Customer3.Merge(m, src) } -func (m *Customer2) XXX_Size() int { +func (m *Customer3) XXX_Size() int { return m.Size() } -func (m *Customer2) XXX_DiscardUnknown() { - xxx_messageInfo_Customer2.DiscardUnknown(m) +func (m *Customer3) XXX_DiscardUnknown() { + xxx_messageInfo_Customer3.DiscardUnknown(m) } -var xxx_messageInfo_Customer2 proto.InternalMessageInfo +var xxx_messageInfo_Customer3 proto.InternalMessageInfo -func (m *Customer2) GetId() int32 { +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.Id + return m.Payment } - return 0 + return nil } -func (m *Customer2) GetIndustry() int32 { +func (m *Customer3) GetId() int32 { if m != nil { - return m.Industry + return m.Id } return 0 } -func (m *Customer2) GetName() string { +func (m *Customer3) GetName() string { if m != nil { return m.Name } return "" } -func (m *Customer2) GetFewer() float32 { +func (m *Customer3) GetSf() float32 { if m != nil { - return m.Fewer + return m.Sf } return 0 } -func (m *Customer2) GetReserved() int64 { +func (m *Customer3) GetSurcharge() float32 { if m != nil { - return m.Reserved + return m.Surcharge } return 0 } -func (m *Customer2) GetCity() Customer2_City { +func (m *Customer3) GetDestination() string { if m != nil { - return m.City + return m.Destination } - return Customer2_Laos + return "" } -func (m *Customer2) GetMiscellaneous() *types.Any { +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.Miscellaneous + return m.Original } 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"` +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Customer3) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Customer3_CreditCardNo)(nil), + (*Customer3_ChequeNo)(nil), + } } -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} +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 *Nested4A) XXX_Unmarshal(b []byte) error { + +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 *Nested4A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Nested4A.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion1.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -851,118 +879,142 @@ func (m *Nested4A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Nested4A) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested4A.Merge(m, src) +func (m *TestVersion1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion1.Merge(m, src) } -func (m *Nested4A) XXX_Size() int { +func (m *TestVersion1) XXX_Size() int { return m.Size() } -func (m *Nested4A) XXX_DiscardUnknown() { - xxx_messageInfo_Nested4A.DiscardUnknown(m) +func (m *TestVersion1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion1.DiscardUnknown(m) } -var xxx_messageInfo_Nested4A proto.InternalMessageInfo +var xxx_messageInfo_TestVersion1 proto.InternalMessageInfo -func (m *Nested4A) GetId() int32 { +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.Id + return m.Sum } - return 0 + return nil } -func (m *Nested4A) GetName() string { +func (m *TestVersion1) GetX() int64 { if m != nil { - return m.Name + return m.X } - return "" + return 0 } -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 *TestVersion1) GetA() *TestVersion1 { + if m != nil { + return m.A + } + return nil } -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} -} -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 *TestVersion1) GetB() *TestVersion1 { + if m != nil { + return m.B } -} -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) + return nil } -var xxx_messageInfo_Nested3A proto.InternalMessageInfo +func (m *TestVersion1) GetC() []*TestVersion1 { + if m != nil { + return m.C + } + return nil +} -func (m *Nested3A) GetId() int32 { +func (m *TestVersion1) GetD() []TestVersion1 { if m != nil { - return m.Id + 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 *Nested3A) GetName() string { - if m != nil { - return m.Name +func (m *TestVersion1) GetF() *TestVersion1 { + if x, ok := m.GetSum().(*TestVersion1_F); ok { + return x.F } - return "" + return nil } -func (m *Nested3A) GetA4() []*Nested4A { +func (m *TestVersion1) GetG() *types.Any { if m != nil { - return m.A4 + return m.G } return nil } -func (m *Nested3A) GetIndex() map[int64]*Nested4A { +func (m *TestVersion1) GetH() []*TestVersion1 { if m != nil { - return m.Index + return m.H } 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"` +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion1) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion1_E)(nil), + (*TestVersion1_F)(nil), + } } -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} +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 *Nested2A) XXX_Unmarshal(b []byte) error { + +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 *Nested2A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Nested2A.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion2.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -972,238 +1024,149 @@ func (m *Nested2A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Nested2A) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested2A.Merge(m, src) +func (m *TestVersion2) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion2.Merge(m, src) } -func (m *Nested2A) XXX_Size() int { +func (m *TestVersion2) XXX_Size() int { return m.Size() } -func (m *Nested2A) XXX_DiscardUnknown() { - xxx_messageInfo_Nested2A.DiscardUnknown(m) +func (m *TestVersion2) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion2.DiscardUnknown(m) } -var xxx_messageInfo_Nested2A proto.InternalMessageInfo +var xxx_messageInfo_TestVersion2 proto.InternalMessageInfo -func (m *Nested2A) GetId() int32 { - if m != nil { - return m.Id - } - return 0 +type isTestVersion2_Sum interface { + isTestVersion2_Sum() + MarshalTo([]byte) (int, error) + Size() int } -func (m *Nested2A) GetName() string { - if m != nil { - return m.Name - } - return "" +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 (m *Nested2A) GetNested() *Nested3A { +func (*TestVersion2_E) isTestVersion2_Sum() {} +func (*TestVersion2_F) isTestVersion2_Sum() {} + +func (m *TestVersion2) GetSum() isTestVersion2_Sum { if m != nil { - return m.Nested + return m.Sum } 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{18} -} -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 { +func (m *TestVersion2) GetX() int64 { if m != nil { - return m.Id + return m.X } return 0 } -func (m *Nested1A) GetNested() *Nested2A { +func (m *TestVersion2) GetA() *TestVersion2 { if m != nil { - return m.Nested + return m.A } 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{19} -} -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 { +func (m *TestVersion2) GetB() *TestVersion2 { if m != nil { - return m.Id + return m.B } - return 0 + return nil } -func (m *Nested4B) GetAge() int32 { +func (m *TestVersion2) GetC() []*TestVersion2 { if m != nil { - return m.Age + return m.C } - return 0 + return nil } -func (m *Nested4B) GetName() string { +func (m *TestVersion2) GetD() []*TestVersion2 { if m != nil { - return m.Name + return m.D } - return "" + return nil } -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 *TestVersion2) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion2_E); ok { + return x.E + } + return 0 } -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} -} -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 *TestVersion2) GetF() *TestVersion2 { + if x, ok := m.GetSum().(*TestVersion2_F); ok { + return x.F } + return 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 { +func (m *TestVersion2) GetG() *types.Any { if m != nil { - return m.Id + return m.G } - return 0 + return nil } -func (m *Nested3B) GetAge() int32 { +func (m *TestVersion2) GetH() []*TestVersion1 { if m != nil { - return m.Age + return m.H } - return 0 + return nil } -func (m *Nested3B) GetName() string { +func (m *TestVersion2) GetNewField() uint64 { if m != nil { - return m.Name + return m.NewField } - return "" + return 0 } -func (m *Nested3B) GetB4() []*Nested4B { - if m != nil { - return m.B4 +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion2) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion2_E)(nil), + (*TestVersion2_F)(nil), } - 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"` +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 *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} +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 *Nested2B) XXX_Unmarshal(b []byte) error { +func (m *TestVersion3) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Nested2B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Nested2B.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion3.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1213,131 +1176,148 @@ func (m *Nested2B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Nested2B) XXX_Merge(src proto.Message) { - xxx_messageInfo_Nested2B.Merge(m, src) +func (m *TestVersion3) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3.Merge(m, src) } -func (m *Nested2B) XXX_Size() int { +func (m *TestVersion3) XXX_Size() int { return m.Size() } -func (m *Nested2B) XXX_DiscardUnknown() { - xxx_messageInfo_Nested2B.DiscardUnknown(m) +func (m *TestVersion3) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3.DiscardUnknown(m) } -var xxx_messageInfo_Nested2B proto.InternalMessageInfo +var xxx_messageInfo_TestVersion3 proto.InternalMessageInfo -func (m *Nested2B) GetId() int32 { +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.Id + return m.Sum } - return 0 + return nil } -func (m *Nested2B) GetFee() float64 { +func (m *TestVersion3) GetX() int64 { if m != nil { - return m.Fee + return m.X } return 0 } -func (m *Nested2B) GetNested() *Nested3B { +func (m *TestVersion3) GetA() *TestVersion3 { if m != nil { - return m.Nested + return m.A } return nil } -func (m *Nested2B) GetRoute() string { +func (m *TestVersion3) GetB() *TestVersion3 { if m != nil { - return m.Route + return m.B } - return "" + return nil } -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 *TestVersion3) GetC() []*TestVersion3 { + if m != nil { + return m.C + } + return nil } -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} -} -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 *TestVersion3) GetD() []*TestVersion3 { + if m != nil { + return m.D } + return 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) + +func (m *TestVersion3) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion3_E); ok { + return x.E + } + return 0 } -var xxx_messageInfo_Nested1B proto.InternalMessageInfo +func (m *TestVersion3) GetF() *TestVersion3 { + if x, ok := m.GetSum().(*TestVersion3_F); ok { + return x.F + } + return nil +} -func (m *Nested1B) GetId() int32 { +func (m *TestVersion3) GetG() *types.Any { if m != nil { - return m.Id + return m.G } - return 0 + return nil } -func (m *Nested1B) GetNested() *Nested2B { +func (m *TestVersion3) GetH() []*TestVersion1 { if m != nil { - return m.Nested + return m.H } return nil } -func (m *Nested1B) GetAge() int32 { +func (m *TestVersion3) GetNonCriticalField() string { if m != nil { - return m.Age + return m.NonCriticalField } - return 0 + return "" } -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"` +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersion3) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersion3_E)(nil), + (*TestVersion3_F)(nil), + } } -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} +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 *Customer3) XXX_Unmarshal(b []byte) error { + +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 *Customer3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion3LoneOneOfValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Customer3.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion3LoneOneOfValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1347,134 +1327,138 @@ func (m *Customer3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Customer3) XXX_Merge(src proto.Message) { - xxx_messageInfo_Customer3.Merge(m, src) +func (m *TestVersion3LoneOneOfValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneOneOfValue.Merge(m, src) } -func (m *Customer3) XXX_Size() int { +func (m *TestVersion3LoneOneOfValue) XXX_Size() int { return m.Size() } -func (m *Customer3) XXX_DiscardUnknown() { - xxx_messageInfo_Customer3.DiscardUnknown(m) +func (m *TestVersion3LoneOneOfValue) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneOneOfValue.DiscardUnknown(m) } -var xxx_messageInfo_Customer3 proto.InternalMessageInfo +var xxx_messageInfo_TestVersion3LoneOneOfValue proto.InternalMessageInfo -type isCustomer3_Payment interface { - isCustomer3_Payment() +type isTestVersion3LoneOneOfValue_Sum interface { + isTestVersion3LoneOneOfValue_Sum() 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"` +type TestVersion3LoneOneOfValue_E struct { + E int32 `protobuf:"varint,6,opt,name=e,proto3,oneof" json:"e,omitempty"` } -func (*Customer3_CreditCardNo) isCustomer3_Payment() {} -func (*Customer3_ChequeNo) isCustomer3_Payment() {} +func (*TestVersion3LoneOneOfValue_E) isTestVersion3LoneOneOfValue_Sum() {} -func (m *Customer3) GetPayment() isCustomer3_Payment { +func (m *TestVersion3LoneOneOfValue) GetSum() isTestVersion3LoneOneOfValue_Sum { if m != nil { - return m.Payment + return m.Sum } return nil } -func (m *Customer3) GetId() int32 { +func (m *TestVersion3LoneOneOfValue) GetX() int64 { if m != nil { - return m.Id + return m.X } return 0 } -func (m *Customer3) GetName() string { +func (m *TestVersion3LoneOneOfValue) GetA() *TestVersion3 { if m != nil { - return m.Name + return m.A } - return "" + return nil } -func (m *Customer3) GetSf() float32 { +func (m *TestVersion3LoneOneOfValue) GetB() *TestVersion3 { if m != nil { - return m.Sf + return m.B } - return 0 + return nil } -func (m *Customer3) GetSurcharge() float32 { +func (m *TestVersion3LoneOneOfValue) GetC() []*TestVersion3 { if m != nil { - return m.Surcharge + return m.C } - return 0 + return nil } -func (m *Customer3) GetDestination() string { +func (m *TestVersion3LoneOneOfValue) GetD() []*TestVersion3 { if m != nil { - return m.Destination + return m.D } - return "" + return nil } -func (m *Customer3) GetCreditCardNo() string { - if x, ok := m.GetPayment().(*Customer3_CreditCardNo); ok { - return x.CreditCardNo +func (m *TestVersion3LoneOneOfValue) GetE() int32 { + if x, ok := m.GetSum().(*TestVersion3LoneOneOfValue_E); ok { + return x.E } - return "" + return 0 } -func (m *Customer3) GetChequeNo() string { - if x, ok := m.GetPayment().(*Customer3_ChequeNo); ok { - return x.ChequeNo +func (m *TestVersion3LoneOneOfValue) GetG() *types.Any { + if m != nil { + return m.G } - return "" + return nil } -func (m *Customer3) GetOriginal() *Customer1 { +func (m *TestVersion3LoneOneOfValue) GetH() []*TestVersion1 { if m != nil { - return m.Original + 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 (*Customer3) XXX_OneofWrappers() []interface{} { +func (*TestVersion3LoneOneOfValue) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*Customer3_CreditCardNo)(nil), - (*Customer3_ChequeNo)(nil), + (*TestVersion3LoneOneOfValue_E)(nil), } } -type TestVersion1 struct { +type TestVersion3LoneNesting 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"` + 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: - // *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"` + // *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"` + *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 *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} +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 *TestVersion1) XXX_Unmarshal(b []byte) error { +func (m *TestVersion3LoneNesting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion3LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion1.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion3LoneNesting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1484,142 +1468,139 @@ func (m *TestVersion1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *TestVersion1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion1.Merge(m, src) +func (m *TestVersion3LoneNesting) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting.Merge(m, src) } -func (m *TestVersion1) XXX_Size() int { +func (m *TestVersion3LoneNesting) XXX_Size() int { return m.Size() } -func (m *TestVersion1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion1.DiscardUnknown(m) +func (m *TestVersion3LoneNesting) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion1 proto.InternalMessageInfo +var xxx_messageInfo_TestVersion3LoneNesting proto.InternalMessageInfo -type isTestVersion1_Sum interface { - isTestVersion1_Sum() +type isTestVersion3LoneNesting_Sum interface { + isTestVersion3LoneNesting_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"` +type TestVersion3LoneNesting_F struct { + F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` } -func (*TestVersion1_E) isTestVersion1_Sum() {} -func (*TestVersion1_F) isTestVersion1_Sum() {} +func (*TestVersion3LoneNesting_F) isTestVersion3LoneNesting_Sum() {} -func (m *TestVersion1) GetSum() isTestVersion1_Sum { +func (m *TestVersion3LoneNesting) GetSum() isTestVersion3LoneNesting_Sum { if m != nil { return m.Sum } return nil } -func (m *TestVersion1) GetX() int64 { +func (m *TestVersion3LoneNesting) GetX() int64 { if m != nil { return m.X } return 0 } -func (m *TestVersion1) GetA() *TestVersion1 { +func (m *TestVersion3LoneNesting) GetA() *TestVersion3 { if m != nil { return m.A } return nil } -func (m *TestVersion1) GetB() *TestVersion1 { +func (m *TestVersion3LoneNesting) GetB() *TestVersion3 { if m != nil { return m.B } return nil } -func (m *TestVersion1) GetC() []*TestVersion1 { +func (m *TestVersion3LoneNesting) GetC() []*TestVersion3 { if m != nil { return m.C } return nil } -func (m *TestVersion1) GetD() []TestVersion1 { +func (m *TestVersion3LoneNesting) GetD() []*TestVersion3 { 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 { +func (m *TestVersion3LoneNesting) GetF() *TestVersion3LoneNesting { + if x, ok := m.GetSum().(*TestVersion3LoneNesting_F); ok { return x.F } return nil } -func (m *TestVersion1) GetG() *types.Any { +func (m *TestVersion3LoneNesting) GetG() *types.Any { if m != nil { return m.G } return nil } -func (m *TestVersion1) GetH() []*TestVersion1 { +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 (*TestVersion1) XXX_OneofWrappers() []interface{} { +func (*TestVersion3LoneNesting) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*TestVersion1_E)(nil), - (*TestVersion1_F)(nil), + (*TestVersion3LoneNesting_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"` +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 *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} +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 *TestVersion2) XXX_Unmarshal(b []byte) error { +func (m *TestVersion3LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion3LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion2.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion3LoneNesting_Inner1.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1629,149 +1610,242 @@ func (m *TestVersion2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *TestVersion2) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion2.Merge(m, src) +func (m *TestVersion3LoneNesting_Inner1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion3LoneNesting_Inner1.Merge(m, src) } -func (m *TestVersion2) XXX_Size() int { +func (m *TestVersion3LoneNesting_Inner1) 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 (m *TestVersion3LoneNesting_Inner1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion3LoneNesting_Inner1.DiscardUnknown(m) } -func (*TestVersion2_E) isTestVersion2_Sum() {} -func (*TestVersion2_F) isTestVersion2_Sum() {} +var xxx_messageInfo_TestVersion3LoneNesting_Inner1 proto.InternalMessageInfo -func (m *TestVersion2) GetSum() isTestVersion2_Sum { +func (m *TestVersion3LoneNesting_Inner1) GetId() int64 { if m != nil { - return m.Sum + return m.Id } - return nil + return 0 } -func (m *TestVersion2) GetX() int64 { +func (m *TestVersion3LoneNesting_Inner1) GetName() string { if m != nil { - return m.X + return m.Name } - return 0 + return "" } -func (m *TestVersion2) GetA() *TestVersion2 { +func (m *TestVersion3LoneNesting_Inner1) GetInner() *TestVersion3LoneNesting_Inner1_InnerInner { if m != nil { - return m.A + return m.Inner } return nil } -func (m *TestVersion2) GetB() *TestVersion2 { - if m != nil { - return m.B +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 } - return 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) } -func (m *TestVersion2) GetC() []*TestVersion2 { +var xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner proto.InternalMessageInfo + +func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetId() string { if m != nil { - return m.C + return m.Id } - return nil + return "" } -func (m *TestVersion2) GetD() []*TestVersion2 { +func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetCity() string { if m != nil { - return m.D + return m.City } - return nil + return "" } -func (m *TestVersion2) GetE() int32 { - if x, ok := m.GetSum().(*TestVersion2_E); ok { - return x.E - } - return 0 +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 *TestVersion2) GetF() *TestVersion2 { - if x, ok := m.GetSum().(*TestVersion2_F); ok { - return x.F +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 } - return 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) } -func (m *TestVersion2) GetG() *types.Any { +var xxx_messageInfo_TestVersion3LoneNesting_Inner2 proto.InternalMessageInfo + +func (m *TestVersion3LoneNesting_Inner2) GetId() string { if m != nil { - return m.G + return m.Id } - return nil + return "" } -func (m *TestVersion2) GetH() []*TestVersion1 { +func (m *TestVersion3LoneNesting_Inner2) GetCountry() string { if m != nil { - return m.H + return m.Country } - return nil + return "" } -func (m *TestVersion2) GetNewField() uint64 { +func (m *TestVersion3LoneNesting_Inner2) GetInner() *TestVersion3LoneNesting_Inner2_InnerInner { if m != nil { - return m.NewField + return m.Inner } - return 0 + return nil } -// 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 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) +} -type TestVersion3 struct { +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: - // *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"` + // *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"` + 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 *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} +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 *TestVersion3) XXX_Unmarshal(b []byte) error { +func (m *TestVersion4LoneNesting) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion4LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion3.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion4LoneNesting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1781,148 +1855,139 @@ func (m *TestVersion3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *TestVersion3) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3.Merge(m, src) +func (m *TestVersion4LoneNesting) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting.Merge(m, src) } -func (m *TestVersion3) XXX_Size() int { +func (m *TestVersion4LoneNesting) XXX_Size() int { return m.Size() } -func (m *TestVersion3) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3.DiscardUnknown(m) +func (m *TestVersion4LoneNesting) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion3 proto.InternalMessageInfo +var xxx_messageInfo_TestVersion4LoneNesting proto.InternalMessageInfo -type isTestVersion3_Sum interface { - isTestVersion3_Sum() +type isTestVersion4LoneNesting_Sum interface { + isTestVersion4LoneNesting_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"` +type TestVersion4LoneNesting_F struct { + F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` } -func (*TestVersion3_E) isTestVersion3_Sum() {} -func (*TestVersion3_F) isTestVersion3_Sum() {} +func (*TestVersion4LoneNesting_F) isTestVersion4LoneNesting_Sum() {} -func (m *TestVersion3) GetSum() isTestVersion3_Sum { +func (m *TestVersion4LoneNesting) GetSum() isTestVersion4LoneNesting_Sum { if m != nil { return m.Sum } return nil } -func (m *TestVersion3) GetX() int64 { +func (m *TestVersion4LoneNesting) GetX() int64 { if m != nil { return m.X } return 0 } -func (m *TestVersion3) GetA() *TestVersion3 { +func (m *TestVersion4LoneNesting) GetA() *TestVersion3 { if m != nil { return m.A } return nil } -func (m *TestVersion3) GetB() *TestVersion3 { +func (m *TestVersion4LoneNesting) GetB() *TestVersion3 { if m != nil { return m.B } return nil } -func (m *TestVersion3) GetC() []*TestVersion3 { +func (m *TestVersion4LoneNesting) GetC() []*TestVersion3 { if m != nil { return m.C } return nil } -func (m *TestVersion3) GetD() []*TestVersion3 { +func (m *TestVersion4LoneNesting) 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 { +func (m *TestVersion4LoneNesting) GetF() *TestVersion3LoneNesting { + if x, ok := m.GetSum().(*TestVersion4LoneNesting_F); ok { return x.F } return nil } -func (m *TestVersion3) GetG() *types.Any { +func (m *TestVersion4LoneNesting) GetG() *types.Any { if m != nil { return m.G } return nil } -func (m *TestVersion3) GetH() []*TestVersion1 { +func (m *TestVersion4LoneNesting) GetH() []*TestVersion1 { if m != nil { return m.H } return nil } -func (m *TestVersion3) GetNonCriticalField() string { +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 (*TestVersion3) XXX_OneofWrappers() []interface{} { +func (*TestVersion4LoneNesting) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*TestVersion3_E)(nil), - (*TestVersion3_F)(nil), + (*TestVersion4LoneNesting_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"` +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 *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{27} +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 *TestVersion3LoneOneOfValue) XXX_Unmarshal(b []byte) error { +func (m *TestVersion4LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion3LoneOneOfValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion4LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion3LoneOneOfValue.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion4LoneNesting_Inner1.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1932,138 +1997,60 @@ func (m *TestVersion3LoneOneOfValue) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *TestVersion3LoneOneOfValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneOneOfValue.Merge(m, src) +func (m *TestVersion4LoneNesting_Inner1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner1.Merge(m, src) } -func (m *TestVersion3LoneOneOfValue) XXX_Size() int { +func (m *TestVersion4LoneNesting_Inner1) 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 (m *TestVersion4LoneNesting_Inner1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner1.DiscardUnknown(m) } -func (*TestVersion3LoneOneOfValue_E) isTestVersion3LoneOneOfValue_Sum() {} - -func (m *TestVersion3LoneOneOfValue) GetSum() isTestVersion3LoneOneOfValue_Sum { - if m != nil { - return m.Sum - } - return nil -} +var xxx_messageInfo_TestVersion4LoneNesting_Inner1 proto.InternalMessageInfo -func (m *TestVersion3LoneOneOfValue) GetX() int64 { +func (m *TestVersion4LoneNesting_Inner1) GetId() int64 { if m != nil { - return m.X + return m.Id } return 0 } -func (m *TestVersion3LoneOneOfValue) GetA() *TestVersion3 { +func (m *TestVersion4LoneNesting_Inner1) GetName() string { if m != nil { - return m.A + return m.Name } - return nil + return "" } -func (m *TestVersion3LoneOneOfValue) GetB() *TestVersion3 { +func (m *TestVersion4LoneNesting_Inner1) GetInner() *TestVersion4LoneNesting_Inner1_InnerInner { if m != nil { - return m.B + return m.Inner } return nil } -func (m *TestVersion3LoneOneOfValue) GetC() []*TestVersion3 { - if m != nil { - return m.C - } - 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 *TestVersion3LoneOneOfValue) GetD() []*TestVersion3 { - if m != nil { - return m.D - } - return nil +func (m *TestVersion4LoneNesting_Inner1_InnerInner) Reset() { + *m = TestVersion4LoneNesting_Inner1_InnerInner{} } - -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 *TestVersion4LoneNesting_Inner1_InnerInner) String() string { + return proto.CompactTextString(m) } - -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} +func (*TestVersion4LoneNesting_Inner1_InnerInner) ProtoMessage() {} +func (*TestVersion4LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16, 0, 0} } -func (m *TestVersion3LoneNesting) XXX_Unmarshal(b []byte) error { +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion3LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2073,139 +2060,50 @@ func (m *TestVersion3LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *TestVersion3LoneNesting) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting.Merge(m, src) +func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Merge(m, src) } -func (m *TestVersion3LoneNesting) XXX_Size() int { +func (m *TestVersion4LoneNesting_Inner1_InnerInner) 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 (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.DiscardUnknown(m) } -func (*TestVersion3LoneNesting_F) isTestVersion3LoneNesting_Sum() {} - -func (m *TestVersion3LoneNesting) GetSum() isTestVersion3LoneNesting_Sum { - if m != nil { - return m.Sum - } - return nil -} +var xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner proto.InternalMessageInfo -func (m *TestVersion3LoneNesting) GetX() int64 { +func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetId() int64 { if m != nil { - return m.X + return m.Id } 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 { +func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetCity() string { if m != nil { - return m.NonCriticalField + return m.City } 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"` +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 *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{28, 0} +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 *TestVersion3LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { +func (m *TestVersion4LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion3LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion4LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner1.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion4LoneNesting_Inner2.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2215,60 +2113,60 @@ func (m *TestVersion3LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *TestVersion3LoneNesting_Inner1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner1.Merge(m, src) +func (m *TestVersion4LoneNesting_Inner2) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner2.Merge(m, src) } -func (m *TestVersion3LoneNesting_Inner1) XXX_Size() int { +func (m *TestVersion4LoneNesting_Inner2) XXX_Size() int { return m.Size() } -func (m *TestVersion3LoneNesting_Inner1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner1.DiscardUnknown(m) +func (m *TestVersion4LoneNesting_Inner2) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner2.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion3LoneNesting_Inner1 proto.InternalMessageInfo +var xxx_messageInfo_TestVersion4LoneNesting_Inner2 proto.InternalMessageInfo -func (m *TestVersion3LoneNesting_Inner1) GetId() int64 { +func (m *TestVersion4LoneNesting_Inner2) GetId() string { if m != nil { return m.Id } - return 0 + return "" } -func (m *TestVersion3LoneNesting_Inner1) GetName() string { +func (m *TestVersion4LoneNesting_Inner2) GetCountry() string { if m != nil { - return m.Name + return m.Country } return "" } -func (m *TestVersion3LoneNesting_Inner1) GetInner() *TestVersion3LoneNesting_Inner1_InnerInner { +func (m *TestVersion4LoneNesting_Inner2) GetInner() *TestVersion4LoneNesting_Inner2_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"` +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 *TestVersion3LoneNesting_Inner1_InnerInner) Reset() { - *m = TestVersion3LoneNesting_Inner1_InnerInner{} +func (m *TestVersion4LoneNesting_Inner2_InnerInner) Reset() { + *m = TestVersion4LoneNesting_Inner2_InnerInner{} } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) String() string { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) String() string { return proto.CompactTextString(m) } -func (*TestVersion3LoneNesting_Inner1_InnerInner) ProtoMessage() {} -func (*TestVersion3LoneNesting_Inner1_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{28, 0, 0} +func (*TestVersion4LoneNesting_Inner2_InnerInner) ProtoMessage() {} +func (*TestVersion4LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { + return fileDescriptor_448ea787339d1228, []int{16, 1, 0} } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2278,50 +2176,55 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, determ return b[:n], nil } } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.Merge(m, src) +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Merge(m, src) } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_Size() int { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Size() int { return m.Size() } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner.DiscardUnknown(m) +func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion3LoneNesting_Inner1_InnerInner proto.InternalMessageInfo +var xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner proto.InternalMessageInfo -func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetId() string { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetId() string { if m != nil { return m.Id } return "" } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) GetCity() string { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetValue() int64 { if m != nil { - return m.City + return m.Value } - return "" + return 0 } -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"` +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 *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{28, 1} +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 *TestVersion3LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { +func (m *TestVersionFD1) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion3LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersionFD1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion3LoneNesting_Inner2.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersionFD1.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2331,126 +2234,114 @@ func (m *TestVersion3LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *TestVersion3LoneNesting_Inner2) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion3LoneNesting_Inner2.Merge(m, src) +func (m *TestVersionFD1) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersionFD1.Merge(m, src) } -func (m *TestVersion3LoneNesting_Inner2) XXX_Size() int { +func (m *TestVersionFD1) XXX_Size() int { return m.Size() } -func (m *TestVersion3LoneNesting_Inner2) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion3LoneNesting_Inner2.DiscardUnknown(m) +func (m *TestVersionFD1) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersionFD1.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion3LoneNesting_Inner2 proto.InternalMessageInfo +var xxx_messageInfo_TestVersionFD1 proto.InternalMessageInfo -func (m *TestVersion3LoneNesting_Inner2) GetId() string { +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.Id + return m.Sum } - return "" + return nil } -func (m *TestVersion3LoneNesting_Inner2) GetCountry() string { +func (m *TestVersionFD1) GetX() int64 { if m != nil { - return m.Country + return m.X } - return "" + return 0 } -func (m *TestVersion3LoneNesting_Inner2) GetInner() *TestVersion3LoneNesting_Inner2_InnerInner { +func (m *TestVersionFD1) GetA() *TestVersion1 { if m != nil { - return m.Inner + return m.A } 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 *TestVersionFD1) GetE() int32 { + if x, ok := m.GetSum().(*TestVersionFD1_E); ok { + return x.E + } + return 0 } -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{28, 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 *TestVersionFD1) GetF() *TestVersion1 { + if x, ok := m.GetSum().(*TestVersionFD1_F); ok { + return x.F } + return 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 { +func (m *TestVersionFD1) GetG() *types.Any { if m != nil { - return m.Id + return m.G } - return "" + return nil } -func (m *TestVersion3LoneNesting_Inner2_InnerInner) GetCity() string { +func (m *TestVersionFD1) GetH() []*TestVersion1 { if m != nil { - return m.City + return m.H } - return "" + return nil } -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"` +// 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: - // *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"` + // *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 *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} +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 *TestVersion4LoneNesting) XXX_Unmarshal(b []byte) error { +func (m *TestVersionFD1WithExtraAny) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion4LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestVersionFD1WithExtraAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting.Marshal(b, m, deterministic) + return xxx_messageInfo_TestVersionFD1WithExtraAny.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2460,139 +2351,109 @@ func (m *TestVersion4LoneNesting) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *TestVersion4LoneNesting) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting.Merge(m, src) +func (m *TestVersionFD1WithExtraAny) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestVersionFD1WithExtraAny.Merge(m, src) } -func (m *TestVersion4LoneNesting) XXX_Size() int { +func (m *TestVersionFD1WithExtraAny) XXX_Size() int { return m.Size() } -func (m *TestVersion4LoneNesting) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting.DiscardUnknown(m) +func (m *TestVersionFD1WithExtraAny) XXX_DiscardUnknown() { + xxx_messageInfo_TestVersionFD1WithExtraAny.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion4LoneNesting proto.InternalMessageInfo +var xxx_messageInfo_TestVersionFD1WithExtraAny proto.InternalMessageInfo -type isTestVersion4LoneNesting_Sum interface { - isTestVersion4LoneNesting_Sum() +type isTestVersionFD1WithExtraAny_Sum interface { + isTestVersionFD1WithExtraAny_Sum() MarshalTo([]byte) (int, error) Size() int } -type TestVersion4LoneNesting_F struct { - F *TestVersion3LoneNesting `protobuf:"bytes,7,opt,name=f,proto3,oneof" json:"f,omitempty"` +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 (*TestVersion4LoneNesting_F) isTestVersion4LoneNesting_Sum() {} +func (*TestVersionFD1WithExtraAny_E) isTestVersionFD1WithExtraAny_Sum() {} +func (*TestVersionFD1WithExtraAny_F) isTestVersionFD1WithExtraAny_Sum() {} -func (m *TestVersion4LoneNesting) GetSum() isTestVersion4LoneNesting_Sum { +func (m *TestVersionFD1WithExtraAny) GetSum() isTestVersionFD1WithExtraAny_Sum { if m != nil { return m.Sum } return nil } -func (m *TestVersion4LoneNesting) GetX() int64 { +func (m *TestVersionFD1WithExtraAny) GetX() int64 { if m != nil { return m.X } return 0 } -func (m *TestVersion4LoneNesting) GetA() *TestVersion3 { +func (m *TestVersionFD1WithExtraAny) GetA() *TestVersion1 { 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 +func (m *TestVersionFD1WithExtraAny) GetE() int32 { + if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_E); ok { + return x.E } - return nil + return 0 } -func (m *TestVersion4LoneNesting) GetF() *TestVersion3LoneNesting { - if x, ok := m.GetSum().(*TestVersion4LoneNesting_F); ok { +func (m *TestVersionFD1WithExtraAny) GetF() *TestVersion1 { + if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_F); ok { return x.F } return nil } -func (m *TestVersion4LoneNesting) GetG() *types.Any { +func (m *TestVersionFD1WithExtraAny) GetG() *AnyWithExtra { if m != nil { return m.G } return nil } -func (m *TestVersion4LoneNesting) GetH() []*TestVersion1 { +func (m *TestVersionFD1WithExtraAny) GetH() []*TestVersion1 { if m != nil { return m.H } return nil } -func (m *TestVersion4LoneNesting) GetNonCriticalField() string { - if m != nil { - return m.NonCriticalField +// XXX_OneofWrappers is for the internal use of the proto package. +func (*TestVersionFD1WithExtraAny) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*TestVersionFD1WithExtraAny_E)(nil), + (*TestVersionFD1WithExtraAny_F)(nil), } - 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"` +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 *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{29, 0} +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 *TestVersion4LoneNesting_Inner1) XXX_Unmarshal(b []byte) error { +func (m *AnyWithExtra) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion4LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *AnyWithExtra) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner1.Marshal(b, m, deterministic) + return xxx_messageInfo_AnyWithExtra.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2602,60 +2463,52 @@ func (m *TestVersion4LoneNesting_Inner1) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *TestVersion4LoneNesting_Inner1) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner1.Merge(m, src) +func (m *AnyWithExtra) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnyWithExtra.Merge(m, src) } -func (m *TestVersion4LoneNesting_Inner1) XXX_Size() int { +func (m *AnyWithExtra) XXX_Size() int { return m.Size() } -func (m *TestVersion4LoneNesting_Inner1) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner1.DiscardUnknown(m) +func (m *AnyWithExtra) XXX_DiscardUnknown() { + xxx_messageInfo_AnyWithExtra.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion4LoneNesting_Inner1 proto.InternalMessageInfo +var xxx_messageInfo_AnyWithExtra proto.InternalMessageInfo -func (m *TestVersion4LoneNesting_Inner1) GetId() int64 { +func (m *AnyWithExtra) GetB() int64 { if m != nil { - return m.Id + return m.B } return 0 } -func (m *TestVersion4LoneNesting_Inner1) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TestVersion4LoneNesting_Inner1) GetInner() *TestVersion4LoneNesting_Inner1_InnerInner { +func (m *AnyWithExtra) GetC() int64 { if m != nil { - return m.Inner + return m.C } - return nil + return 0 } -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"` +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 *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{29, 0, 0} +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 *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Unmarshal(b []byte) error { +func (m *TestUpdatedTxRaw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestUpdatedTxRaw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Marshal(b, m, deterministic) + return xxx_messageInfo_TestUpdatedTxRaw.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2665,50 +2518,75 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Marshal(b []byte, determ return b[:n], nil } } -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.Merge(m, src) +func (m *TestUpdatedTxRaw) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestUpdatedTxRaw.Merge(m, src) } -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_Size() int { +func (m *TestUpdatedTxRaw) XXX_Size() int { return m.Size() } -func (m *TestVersion4LoneNesting_Inner1_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner.DiscardUnknown(m) +func (m *TestUpdatedTxRaw) XXX_DiscardUnknown() { + xxx_messageInfo_TestUpdatedTxRaw.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion4LoneNesting_Inner1_InnerInner proto.InternalMessageInfo +var xxx_messageInfo_TestUpdatedTxRaw proto.InternalMessageInfo -func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetId() int64 { +func (m *TestUpdatedTxRaw) GetBodyBytes() []byte { if m != nil { - return m.Id + return m.BodyBytes } - return 0 + return nil } -func (m *TestVersion4LoneNesting_Inner1_InnerInner) GetCity() string { +func (m *TestUpdatedTxRaw) GetAuthInfoBytes() []byte { if m != nil { - return m.City + return m.AuthInfoBytes } - return "" + return nil } -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 *TestUpdatedTxRaw) GetSignatures() [][]byte { + if m != nil { + return m.Signatures + } + return nil } -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{29, 1} +func (m *TestUpdatedTxRaw) GetNewField_5() []byte { + if m != nil { + return m.NewField_5 + } + return nil } -func (m *TestVersion4LoneNesting_Inner2) XXX_Unmarshal(b []byte) error { + +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 *TestVersion4LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestUpdatedTxBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner2.Marshal(b, m, deterministic) + return xxx_messageInfo_TestUpdatedTxBody.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2718,60 +2596,86 @@ func (m *TestVersion4LoneNesting_Inner2) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *TestVersion4LoneNesting_Inner2) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner2.Merge(m, src) +func (m *TestUpdatedTxBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestUpdatedTxBody.Merge(m, src) } -func (m *TestVersion4LoneNesting_Inner2) XXX_Size() int { +func (m *TestUpdatedTxBody) XXX_Size() int { return m.Size() } -func (m *TestVersion4LoneNesting_Inner2) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner2.DiscardUnknown(m) +func (m *TestUpdatedTxBody) XXX_DiscardUnknown() { + xxx_messageInfo_TestUpdatedTxBody.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion4LoneNesting_Inner2 proto.InternalMessageInfo +var xxx_messageInfo_TestUpdatedTxBody proto.InternalMessageInfo -func (m *TestVersion4LoneNesting_Inner2) GetId() string { +func (m *TestUpdatedTxBody) GetMessages() []*types.Any { if m != nil { - return m.Id + return m.Messages + } + return nil +} + +func (m *TestUpdatedTxBody) GetMemo() string { + if m != nil { + return m.Memo } return "" } -func (m *TestVersion4LoneNesting_Inner2) GetCountry() string { +func (m *TestUpdatedTxBody) GetTimeoutHeight() int64 { if m != nil { - return m.Country + 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 *TestVersion4LoneNesting_Inner2) GetInner() *TestVersion4LoneNesting_Inner2_InnerInner { +func (m *TestUpdatedTxBody) GetExtensionOptions() []*types.Any { if m != nil { - return m.Inner + return m.ExtensionOptions } 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 *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*types.Any { + if m != nil { + return m.NonCriticalExtensionOptions + } + return nil } -func (m *TestVersion4LoneNesting_Inner2_InnerInner) Reset() { - *m = TestVersion4LoneNesting_Inner2_InnerInner{} -} -func (m *TestVersion4LoneNesting_Inner2_InnerInner) String() string { - return proto.CompactTextString(m) +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 (*TestVersion4LoneNesting_Inner2_InnerInner) ProtoMessage() {} -func (*TestVersion4LoneNesting_Inner2_InnerInner) Descriptor() ([]byte, []int) { - return fileDescriptor_2fcc84b9998d60d8, []int{29, 1, 0} + +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 *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Unmarshal(b []byte) error { +func (m *TestUpdatedAuthInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestUpdatedAuthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Marshal(b, m, deterministic) + return xxx_messageInfo_TestUpdatedAuthInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2781,172 +2685,62 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Marshal(b []byte, determ return b[:n], nil } } -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.Merge(m, src) +func (m *TestUpdatedAuthInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestUpdatedAuthInfo.Merge(m, src) } -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_Size() int { +func (m *TestUpdatedAuthInfo) XXX_Size() int { return m.Size() } -func (m *TestVersion4LoneNesting_Inner2_InnerInner) XXX_DiscardUnknown() { - xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner.DiscardUnknown(m) +func (m *TestUpdatedAuthInfo) XXX_DiscardUnknown() { + xxx_messageInfo_TestUpdatedAuthInfo.DiscardUnknown(m) } -var xxx_messageInfo_TestVersion4LoneNesting_Inner2_InnerInner proto.InternalMessageInfo +var xxx_messageInfo_TestUpdatedAuthInfo proto.InternalMessageInfo -func (m *TestVersion4LoneNesting_Inner2_InnerInner) GetId() string { +func (m *TestUpdatedAuthInfo) GetSignerInfos() []*tx.SignerInfo { 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{30} -} -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 m.SignerInfos } return nil } -func (m *TestVersionFD1) GetX() int64 { - if m != nil { - return m.X - } - return 0 -} - -func (m *TestVersionFD1) GetA() *TestVersion1 { +func (m *TestUpdatedAuthInfo) GetFee() *tx.Fee { 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 m.Fee } return nil } -func (m *TestVersionFD1) GetG() *types.Any { +func (m *TestUpdatedAuthInfo) GetNewField_3() []byte { if m != nil { - return m.G + return m.NewField_3 } return nil } -func (m *TestVersionFD1) GetH() []*TestVersion1 { +func (m *TestUpdatedAuthInfo) GetNewField_1024() []byte { if m != nil { - return m.H + return m.NewField_1024 } 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"` +type TestRepeatedUints struct { + Nums []uint64 `protobuf:"varint,1,rep,packed,name=nums,proto3" json:"nums,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{31} +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 *TestVersionFD1WithExtraAny) XXX_Unmarshal(b []byte) error { +func (m *TestRepeatedUints) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TestVersionFD1WithExtraAny) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TestRepeatedUints) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TestVersionFD1WithExtraAny.Marshal(b, m, deterministic) + return xxx_messageInfo_TestRepeatedUints.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2956,830 +2750,632 @@ func (m *TestVersionFD1WithExtraAny) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *TestVersionFD1WithExtraAny) XXX_Merge(src proto.Message) { - xxx_messageInfo_TestVersionFD1WithExtraAny.Merge(m, src) +func (m *TestRepeatedUints) XXX_Merge(src proto.Message) { + xxx_messageInfo_TestRepeatedUints.Merge(m, src) } -func (m *TestVersionFD1WithExtraAny) XXX_Size() int { +func (m *TestRepeatedUints) 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 (m *TestRepeatedUints) XXX_DiscardUnknown() { + xxx_messageInfo_TestRepeatedUints.DiscardUnknown(m) } -func (*TestVersionFD1WithExtraAny_E) isTestVersionFD1WithExtraAny_Sum() {} -func (*TestVersionFD1WithExtraAny_F) isTestVersionFD1WithExtraAny_Sum() {} +var xxx_messageInfo_TestRepeatedUints proto.InternalMessageInfo -func (m *TestVersionFD1WithExtraAny) GetSum() isTestVersionFD1WithExtraAny_Sum { +func (m *TestRepeatedUints) GetNums() []uint64 { if m != nil { - return m.Sum + return m.Nums } 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 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 (m *TestVersionFD1WithExtraAny) GetE() int32 { - if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_E); ok { - return x.E - } - return 0 +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, 0x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, 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 *TestVersionFD1WithExtraAny) GetF() *TestVersion1 { - if x, ok := m.GetSum().(*TestVersionFD1WithExtraAny_F); ok { - return x.F +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 nil + return dAtA[:n], nil } -func (m *TestVersionFD1WithExtraAny) GetG() *AnyWithExtra { - if m != nil { - return m.G - } - return nil +func (m *Customer1) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersionFD1WithExtraAny) GetH() []*TestVersion1 { - if m != nil { - return m.H +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 } - return nil + 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 } -// XXX_OneofWrappers is for the internal use of the proto package. -func (*TestVersionFD1WithExtraAny) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*TestVersionFD1WithExtraAny_E)(nil), - (*TestVersionFD1WithExtraAny_F)(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 } -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 *Customer2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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} -} -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 +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)) } - return b[:n], nil + 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 *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) + +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 } -var xxx_messageInfo_AnyWithExtra proto.InternalMessageInfo +func (m *Nested4A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} -func (m *AnyWithExtra) GetB() int64 { - if m != nil { - return m.B +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 } - return 0 + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *AnyWithExtra) GetC() int64 { - if m != nil { - return m.C +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 0 + return dAtA[:n], nil } -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 *Nested3A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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} -} -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 +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 } - 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 + 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 + } } - return nil -} - -func (m *TestUpdatedTxRaw) GetAuthInfoBytes() []byte { - if m != nil { - return m.AuthInfoBytes + 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 } - return nil + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *TestUpdatedTxRaw) GetSignatures() [][]byte { - if m != nil { - return m.Signatures +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 nil + return dAtA[:n], nil } -func (m *TestUpdatedTxRaw) GetNewField_5() []byte { - if m != nil { - return m.NewField_5 - } - return nil +func (m *Nested2A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestUpdatedTxRaw) GetNewField_1024() []byte { - if m != nil { - return m.NewField_1024 +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 } - return nil + 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 } -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 *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 *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} -} -func (m *TestUpdatedTxBody) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *Nested1A) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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 + +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)) } - return b[:n], nil + i-- + dAtA[i] = 0x12 } -} -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 + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return nil + return len(dAtA) - i, nil } -func (m *TestUpdatedTxBody) GetMemo() string { - if m != nil { - return m.Memo +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 "" + return dAtA[:n], nil } -func (m *TestUpdatedTxBody) GetTimeoutHeight() int64 { - if m != nil { - return m.TimeoutHeight - } - return 0 +func (m *Nested4B) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestUpdatedTxBody) GetSomeNewField() uint64 { - if m != nil { - return m.SomeNewField +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 } - return 0 -} - -func (m *TestUpdatedTxBody) GetSomeNewFieldNonCriticalField() string { - if m != nil { - return m.SomeNewFieldNonCriticalField + if m.Age != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) + i-- + dAtA[i] = 0x10 } - return "" -} - -func (m *TestUpdatedTxBody) GetExtensionOptions() []*types.Any { - if m != nil { - return m.ExtensionOptions + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - return nil + return len(dAtA) - i, nil } -func (m *TestUpdatedTxBody) GetNonCriticalExtensionOptions() []*types.Any { - if m != nil { - return m.NonCriticalExtensionOptions +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 nil + return dAtA[:n], 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 *Nested3B) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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} -} -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 +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 } - 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 + 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 } - return nil + 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 *TestUpdatedAuthInfo) GetFee() *tx.Fee { - if m != nil { - return m.Fee +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 nil + return dAtA[:n], 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{36} -} -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((*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") - 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{ - // 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,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 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) -} - -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...) - if err != nil { - return nil, err - } - return out, 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 - } - return out, 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...) - 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) { +func (m *Nested2B) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Dog) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Nested2B) 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))) + 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] = 0x12 + dAtA[i] = 0x22 } - if len(m.Size_) > 0 { - i -= len(m.Size_) - copy(dAtA[i:], m.Size_) - i = encodeVarintProto(dAtA, i, uint64(len(m.Size_))) + 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] = 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 + dAtA[i] = 0x1a } - 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)) + if m.Fee != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Fee)))) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x11 } - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintProto(dAtA, i, uint64(len(m.Moniker))) + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *HasAnimal) Marshal() (dAtA []byte, err error) { +func (m *Nested1B) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3789,37 +3385,42 @@ func (m *HasAnimal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HasAnimal) MarshalTo(dAtA []byte) (int, error) { +func (m *Nested1B) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Nested1B) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + if m.Age != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Age)) i-- - dAtA[i] = 0x10 + dAtA[i] = 0x18 } - if m.Animal != nil { + if m.Nested != nil { { - size, err := m.Animal.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + 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 *HasHasAnimal) Marshal() (dAtA []byte, err error) { +func (m *Customer3) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3829,187 +3430,100 @@ func (m *HasHasAnimal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HasHasAnimal) MarshalTo(dAtA []byte) (int, error) { +func (m *Customer3) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HasHasAnimal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Customer3) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.HasAnimal != nil { + if m.Original != nil { { - size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Original.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(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 + dAtA[i] = 0x4a } - 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 { + if m.Payment != nil { { - size, err := m.HasHasAnimal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.Payment.Size() + i -= size + if _, err := m.Payment.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) } + } + 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] = 0xa + dAtA[i] = 0x2a } - 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 + if m.Surcharge != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Surcharge)))) + i-- + dAtA[i] = 0x25 } - 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))) + if m.Sf != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Sf)))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x1d } - 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 + 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 } - 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))) + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } 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) { +func (m *Customer3_CreditCardNo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SayHelloRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Customer3_CreditCardNo) 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 - } + 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 *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) { +func (m *Customer3_ChequeNo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SayHelloResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Customer3_ChequeNo) 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 - } + 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 *TestAnyRequest) Marshal() (dAtA []byte, err error) { +func (m *TestVersion1) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4019,99 +3533,157 @@ func (m *TestAnyRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestAnyRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion1) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestAnyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.AnyAnimal != nil { + if m.Customer1 != nil { { - size, err := m.AnyAnimal.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x62 } - 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 + 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 + } } - 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 { + if m.G != nil { { - size, err := m.HasAnimal.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + 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 *TestMsg) Marshal() (dAtA []byte, err error) { +func (m *TestVersion1_E) MarshalTo(dAtA []byte) (int, 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 m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestMsg) MarshalTo(dAtA []byte) (int, error) { +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 *TestMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion1_F) 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 + 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 *BadMultiSignature) Marshal() (dAtA []byte, err error) { +func (m *TestVersion2) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4121,193 +3693,164 @@ func (m *BadMultiSignature) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *BadMultiSignature) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion2) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *BadMultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion2) 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))) + if m.NewField != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.NewField)) 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))) + dAtA[i] = 0x1 i-- - dAtA[i] = 0x12 + dAtA[i] = 0xc8 } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + 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] = 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 + dAtA[i] = 0x62 } - 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 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.Miscellaneous != nil { + if m.G != nil { { - size, err := m.Miscellaneous.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x52 + dAtA[i] = 0x42 } - if m.City != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.City)) - i-- - dAtA[i] = 0x30 + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - 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.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.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + 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.Industry != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Industry)) + 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] = 0x10 + dAtA[i] = 0x12 } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *Nested4A) Marshal() (dAtA []byte, err error) { +func (m *TestVersion2_E) MarshalTo(dAtA []byte) (int, 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 m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Nested4A) MarshalTo(dAtA []byte) (int, error) { +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 *Nested4A) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion2_F) 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)) + 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] = 0x8 + dAtA[i] = 0x3a } return len(dAtA) - i, nil } - -func (m *Nested3A) Marshal() (dAtA []byte, err error) { +func (m *TestVersion3) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4317,157 +3860,166 @@ func (m *Nested3A) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Nested3A) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion3) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Nested3A) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3) 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 + 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 = encodeVarintProto(dAtA, i, uint64(k)) - i-- - dAtA[i] = 0x8 - i = encodeVarintProto(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x62 } - if len(m.A4) > 0 { - for iNdEx := len(m.A4) - 1; iNdEx >= 0; iNdEx-- { + if len(m.H) > 0 { + for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.A4[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x4a } } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + 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] = 0x12 + dAtA[i] = 0x42 } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - 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 + 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 + } } - 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 { + 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.Nested.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.B.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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 = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + 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.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *Nested1A) Marshal() (dAtA []byte, err error) { +func (m *TestVersion3_E) MarshalTo(dAtA []byte) (int, 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 m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Nested1A) MarshalTo(dAtA []byte) (int, error) { +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 *Nested1A) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - _ = i - var l int - _ = l - if m.Nested != nil { + if m.F != nil { { - size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.F.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 + dAtA[i] = 0x3a } return len(dAtA) - i, nil } - -func (m *Nested4B) Marshal() (dAtA []byte, err error) { +func (m *TestVersion3LoneOneOfValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4477,144 +4029,145 @@ func (m *Nested4B) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Nested4B) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion3LoneOneOfValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Nested4B) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3LoneOneOfValue) 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))) + 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] = 0x1a + dAtA[i] = 0x40 + i-- + dAtA[i] = 0xba } - if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) + 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] = 0x10 + dAtA[i] = 0x62 } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + 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] = 0x8 + dAtA[i] = 0x42 } - 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 + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, 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-- { + if len(m.D) > 0 { + for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.B4[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + 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 = encodeVarintProto(dAtA, i, uint64(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 = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + 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.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) + 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] = 0x10 + dAtA[i] = 0x12 } - if m.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *Nested2B) Marshal() (dAtA []byte, err error) { +func (m *TestVersion3LoneOneOfValue_E) MarshalTo(dAtA []byte) (int, 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 m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Nested2B) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Nested2B) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3LoneOneOfValue_E) 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 - } + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.E)) + i-- + dAtA[i] = 0x30 return len(dAtA) - i, nil } - -func (m *Nested1B) Marshal() (dAtA []byte, err error) { +func (m *TestVersion3LoneNesting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4624,164 +4177,49 @@ func (m *Nested1B) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Nested1B) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Nested1B) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Age != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Age)) + 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] = 0x18 + dAtA[i] = 0x40 + i-- + dAtA[i] = 0xba } - if m.Nested != nil { + if m.Inner2 != nil { { - size, err := m.Nested.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Inner2.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(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 + dAtA[i] = 0x7a } - 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 { + if m.Inner1 != nil { { - size, err := m.Original.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Inner1.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 - } + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } - } - 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 + dAtA[i] = 0x72 } - 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]) @@ -4789,7 +4227,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -4802,7 +4240,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -4815,7 +4253,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -4837,7 +4275,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -4851,7 +4289,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -4864,7 +4302,7 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -4876,37 +4314,25 @@ func (m *TestVersion1) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + 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 = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersion1_F) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting_F) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.F != nil { { @@ -4915,14 +4341,14 @@ func (m *TestVersion1_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a } return len(dAtA) - i, nil } -func (m *TestVersion2) Marshal() (dAtA []byte, err error) { +func (m *TestVersion3LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4932,164 +4358,167 @@ func (m *TestVersion2) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion2) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion2) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting_Inner1) 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 { + if m.Inner != nil { { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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 = encodeVarintProto(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } + dAtA[i] = 0x1a } - 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)) - } + 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] = 0x42 + dAtA[i] = 0x12 } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - 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 - } + 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 } - 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 - } + 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 m.B != nil { + 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.B.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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 = encodeVarintProto(dAtA, i, uint64(size)) - } + 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 m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *TestVersion2_E) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting_Inner2_InnerInner) Marshal() (dAtA []byte, err error) { size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -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) { +func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion2_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion3LoneNesting_Inner2_InnerInner) 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 + 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] = 0x3a + 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 *TestVersion3) Marshal() (dAtA []byte, err error) { + +func (m *TestVersion4LoneNesting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5099,12 +4528,12 @@ func (m *TestVersion3) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion3) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5112,12 +4541,36 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.NonCriticalField) > 0 { i -= len(m.NonCriticalField) copy(dAtA[i:], m.NonCriticalField) - i = encodeVarintProto(dAtA, i, uint64(len(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]) @@ -5125,7 +4578,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x62 @@ -5138,7 +4591,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -5151,7 +4604,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5173,7 +4626,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a @@ -5187,7 +4640,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 @@ -5200,7 +4653,7 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a @@ -5212,37 +4665,25 @@ func (m *TestVersion3) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + 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 = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 - return len(dAtA) - i, nil -} -func (m *TestVersion3_F) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting_F) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.F != nil { { @@ -5251,14 +4692,14 @@ func (m *TestVersion3_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x3a } return len(dAtA) - i, nil } -func (m *TestVersion3LoneOneOfValue) Marshal() (dAtA []byte, err error) { +func (m *TestVersion4LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5268,145 +4709,163 @@ func (m *TestVersion3LoneOneOfValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion3LoneOneOfValue) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneOneOfValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting_Inner1) 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 { + if m.Inner != nil { { - size, err := m.Customer1.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x62 + dAtA[i] = 0x1a } - 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 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.G != nil { - { - size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) - } + if m.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) i-- - dAtA[i] = 0x42 + dAtA[i] = 0x8 } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + 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 } - 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 - } + 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 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.Id != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.Id)) + i-- + dAtA[i] = 0x8 } - if m.B != nil { + 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.B.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Inner.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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 = encodeVarintProto(dAtA, i, uint64(size)) - } + 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 m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *TestVersion3LoneOneOfValue_E) MarshalTo(dAtA []byte) (int, error) { +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 *TestVersion3LoneOneOfValue_E) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - i = encodeVarintProto(dAtA, i, uint64(m.E)) - i-- - dAtA[i] = 0x30 + _ = 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 *TestVersion3LoneNesting) Marshal() (dAtA []byte, err error) { + +func (m *TestVersionFD1) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5416,61 +4875,16 @@ func (m *TestVersion3LoneNesting) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion3LoneNesting) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersionFD1) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersionFD1) 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-- { { @@ -5479,7 +4893,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x4a @@ -5492,7 +4906,7 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x42 @@ -5506,46 +4920,6 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) } } } - 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]) @@ -5553,25 +4927,37 @@ func (m *TestVersion3LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } if m.X != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.X)) + 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) { +func (m *TestVersionFD1_E) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, error) { +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 { { @@ -5580,14 +4966,14 @@ func (m *TestVersion3LoneNesting_F) MarshalToSizedBuffer(dAtA []byte) (int, erro return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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) { +func (m *TestVersionFD1WithExtraAny) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5597,81 +4983,105 @@ func (m *TestVersion3LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion3LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { +func (m *TestVersionFD1WithExtraAny) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Inner != nil { + 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.Inner.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.G.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x42 } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintProto(dAtA, i, uint64(len(m.Name))) + 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.Id != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Id)) + if m.X != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.X)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) Marshal() (dAtA []byte, err error) { +func (m *TestVersionFD1WithExtraAny_E) MarshalTo(dAtA []byte) (int, 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 m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneNesting_Inner1_InnerInner) MarshalTo(dAtA []byte) (int, error) { +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 *TestVersion3LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestVersionFD1WithExtraAny_F) 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))) + 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] = 0xa + dAtA[i] = 0x3a } return len(dAtA) - i, nil } - -func (m *TestVersion3LoneNesting_Inner2) Marshal() (dAtA []byte, err error) { +func (m *AnyWithExtra) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5681,46 +5091,42 @@ func (m *TestVersion3LoneNesting_Inner2) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion3LoneNesting_Inner2) MarshalTo(dAtA []byte) (int, error) { +func (m *AnyWithExtra) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *AnyWithExtra) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Inner != nil { + 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.Inner.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Any.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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 = 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) { +func (m *TestUpdatedTxRaw) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5730,34 +5136,59 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Marshal() (dAtA []byte, err return dAtA[:n], nil } -func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { +func (m *TestUpdatedTxRaw) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion3LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestUpdatedTxRaw) 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))) + 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.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintProto(dAtA, i, uint64(len(m.Id))) + 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 *TestVersion4LoneNesting) Marshal() (dAtA []byte, err error) { +func (m *TestUpdatedTxBody) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5767,178 +5198,157 @@ func (m *TestVersion4LoneNesting) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion4LoneNesting) MarshalTo(dAtA []byte) (int, error) { +func (m *TestUpdatedTxBody) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion4LoneNesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestUpdatedTxBody) 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))) + 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] = 0x40 + dAtA[i] = 0x41 i-- - dAtA[i] = 0xba + dAtA[i] = 0xd2 } - if m.Inner2 != nil { - { - size, err := m.Inner2.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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 -= size - i = encodeVarintProto(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] = 0x7a + dAtA[i] = 0x20 } - 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)) - } + if m.TimeoutHeight != 0 { + i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.TimeoutHeight)) i-- - dAtA[i] = 0x72 + dAtA[i] = 0x18 } - 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)) - } + 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] = 0x62 + dAtA[i] = 0x12 } - if len(m.H) > 0 { - for iNdEx := len(m.H) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Messages) > 0 { + for iNdEx := len(m.Messages) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.H[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Messages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x4a + dAtA[i] = 0xa } } - if m.G != nil { + 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.G.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(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 - } - } + dAtA[i] = 0x12 } - if len(m.D) > 0 { - for iNdEx := len(m.D) - 1; iNdEx >= 0; iNdEx-- { + if len(m.SignerInfos) > 0 { + for iNdEx := len(m.SignerInfos) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.D[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.SignerInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0xa } } - 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) { +func (m *TestRepeatedUints) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5948,1227 +5358,941 @@ func (m *TestVersion4LoneNesting_Inner1) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *TestVersion4LoneNesting_Inner1) MarshalTo(dAtA []byte) (int, error) { +func (m *TestRepeatedUints) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *TestVersion4LoneNesting_Inner1) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TestRepeatedUints) 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 + 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++ } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + dAtA54[j53] = uint8(num) + j53++ } + i -= j53 + copy(dAtA[i:], dAtA54[:j53]) + i = encodeVarintUnknonwnproto(dAtA, i, uint64(j53)) 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 + dAtA[i] = 0xa } 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 +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++ } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } - -func (m *TestVersion4LoneNesting_Inner1_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Customer1) Size() (n int) { + if m == nil { + return 0 + } 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 + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - 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 + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner2) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + if m.SubscriptionFee != 0 { + n += 5 + } + l = len(m.Payment) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n } -func (m *TestVersion4LoneNesting_Inner2) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Customer2) Size() (n int) { + if m == nil { + return 0 + } 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 m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - 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 m.Industry != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Industry)) } - 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 + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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 + if m.Fewer != 0 { + n += 5 } - return dAtA[:n], nil -} - -func (m *TestVersion4LoneNesting_Inner2_InnerInner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + 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 *TestVersion4LoneNesting_Inner2_InnerInner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Nested4A) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - if m.Value != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.Value)) - i-- - dAtA[i] = 0x10 + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - 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 + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - return len(dAtA) - i, nil + return n } -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 +func (m *Nested3A) Size() (n int) { + if m == nil { + return 0 } - 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.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - 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 + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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.A4) > 0 { + for _, e := range m.A4 { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } } - if m.A != nil { - { - size, err := m.A.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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)) } - i -= size - i = encodeVarintProto(dAtA, i, uint64(size)) + mapEntrySize := 1 + sovUnknonwnproto(uint64(k)) + l + n += mapEntrySize + 1 + sovUnknonwnproto(uint64(mapEntrySize)) } - 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]) + return n } -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 *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 *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 +func (m *Nested1A) Size() (n int) { + if m == nil { + return 0 } - 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 + var l int + _ = l + if m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - return dAtA[:n], nil + if m.Nested != nil { + l = m.Nested.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n } -func (m *TestVersionFD1WithExtraAny) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +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 *TestVersionFD1WithExtraAny) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Nested3B) Size() (n int) { + if m == nil { + return 0 + } 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.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - 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.Age != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Age)) } - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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)) + if len(m.B4) > 0 { + for _, e := range m.B4 { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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]) + return n } -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 +func (m *Nested2B) Size() (n int) { + if m == nil { + return 0 } - 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.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - if m.B != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.B)) - i-- - dAtA[i] = 0x18 + if m.Fee != 0 { + n += 9 } - 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 + if m.Nested != nil { + l = m.Nested.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - return len(dAtA) - i, nil + l = len(m.Route) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n } -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 +func (m *Nested1B) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil -} - -func (m *TestUpdatedTxRaw) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + 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 *TestUpdatedTxRaw) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *Customer3) Size() (n int) { + if m == nil { + return 0 + } 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 m.Id != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - 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 + l = len(m.Name) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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 m.Sf != 0 { + n += 5 } - 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 m.Surcharge != 0 { + n += 5 } - 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 + l = len(m.Destination) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - return len(dAtA) - i, nil + 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 *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 +func (m *Customer3_CreditCardNo) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + l = len(m.CreditCardNo) + n += 1 + l + sovUnknonwnproto(uint64(l)) + return n } - -func (m *TestUpdatedTxBody) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +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 *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *TestVersion1) Size() (n int) { + if m == nil { + return 0 + } 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 m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) } - 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 m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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.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 m.SomeNewField != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.SomeNewField)) - i-- - dAtA[i] = 0x20 + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } } - if m.TimeoutHeight != 0 { - i = encodeVarintProto(dAtA, i, uint64(m.TimeoutHeight)) - i-- - dAtA[i] = 0x18 + if m.Sum != nil { + n += m.Sum.Size() } - 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 m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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 + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } } - return len(dAtA) - i, nil + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } + return n } -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 +func (m *TestVersion1_E) Size() (n int) { + if m == nil { + return 0 } - return dAtA[:n], nil + var l int + _ = l + n += 1 + sovUnknonwnproto(uint64(m.E)) + return n } - -func (m *TestUpdatedAuthInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +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 *TestUpdatedAuthInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i +func (m *TestVersion2) Size() (n int) { + if m == nil { + return 0 + } 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 m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) } - 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.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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)) + 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)) } - 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 + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } } - 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 { - dAtA59 := make([]byte, len(m.Nums)*10) - var j58 int - for _, num := range m.Nums { - for num >= 1<<7 { - dAtA59[j58] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j58++ - } - dAtA59[j58] = uint8(num) - j58++ - } - i -= j58 - copy(dAtA[i:], dAtA59[:j58]) - i = encodeVarintProto(dAtA, i, uint64(j58)) - i-- - dAtA[i] = 0xa + if m.Sum != nil { + n += m.Sum.Size() } - 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++ + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - dAtA[offset] = uint8(v) - return base -} -func (m *Dog) Size() (n int) { - if m == nil { - return 0 + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } } - var l int - _ = l - l = len(m.Size_) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) + if m.NewField != 0 { + n += 2 + sovUnknonwnproto(uint64(m.NewField)) } return n } -func (m *Cat) Size() (n int) { +func (m *TestVersion2_E) 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)) - } + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } - -func (m *HasAnimal) Size() (n int) { +func (m *TestVersion2_F) 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)) + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } - -func (m *HasHasAnimal) Size() (n int) { +func (m *TestVersion3) 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)) + 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 *HasHasHasAnimal) Size() (n int) { +func (m *TestVersion3_E) 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)) - } + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } - -func (m *EchoRequest) Size() (n int) { +func (m *TestVersion3_F) 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 m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } - -func (m *EchoResponse) Size() (n int) { +func (m *TestVersion3LoneOneOfValue) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Message) + 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 += 1 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *SayHelloRequest) Size() (n int) { +func (m *TestVersion3LoneOneOfValue_E) 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)) - } + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } - -func (m *SayHelloResponse) Size() (n int) { +func (m *TestVersion3LoneNesting) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Greeting) + 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 += 1 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *TestAnyRequest) Size() (n int) { +func (m *TestVersion3LoneNesting_F) 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)) + if m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } - -func (m *TestAnyResponse) Size() (n int) { +func (m *TestVersion3LoneNesting_Inner1) 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)) + 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 *TestMsg) Size() (n int) { +func (m *TestVersion3LoneNesting_Inner1_InnerInner) 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)) - } + 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 *BadMultiSignature) Size() (n int) { +func (m *TestVersion3LoneNesting_Inner2) 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.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - l = len(m.MaliciousField) + l = len(m.Country) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *Customer1) Size() (n int) { +func (m *TestVersion3LoneNesting_Inner2_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.Name) + l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) - } - if m.SubscriptionFee != 0 { - n += 5 + n += 1 + l + sovUnknonwnproto(uint64(l)) } - l = len(m.Payment) + l = len(m.City) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *Customer2) Size() (n int) { +func (m *TestVersion4LoneNesting) 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)) + if m.X != 0 { + n += 1 + sovUnknonwnproto(uint64(m.X)) } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) + if m.A != nil { + l = m.A.Size() + n += 1 + l + sovUnknonwnproto(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 m.B != nil { + l = m.B.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if len(m.A4) > 0 { - for _, e := range m.A4 { + if len(m.C) > 0 { + for _, e := range m.C { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + 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 + sovProto(uint64(l)) - } - mapEntrySize := 1 + sovProto(uint64(k)) + l - n += mapEntrySize + 1 + sovProto(uint64(mapEntrySize)) + if len(m.D) > 0 { + for _, e := range m.D { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } } - return n -} - -func (m *Nested2A) Size() (n int) { - if m == nil { - return 0 + if m.Sum != nil { + n += m.Sum.Size() } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + if m.G != nil { + l = m.G.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovProto(uint64(l)) + if len(m.H) > 0 { + for _, e := range m.H { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + if m.Customer1 != nil { + l = m.Customer1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - return n -} - -func (m *Nested1A) Size() (n int) { - if m == nil { - return 0 + if m.Inner1 != nil { + l = m.Inner1.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovProto(uint64(m.Id)) + if m.Inner2 != nil { + l = m.Inner2.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + l = len(m.NonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *Nested4B) Size() (n int) { +func (m *TestVersion4LoneNesting_F) 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 m.F != nil { + l = m.F.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } - -func (m *Nested3B) Size() (n int) { +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)) - } - if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) + n += 1 + sovUnknonwnproto(uint64(m.Id)) } l = len(m.Name) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if len(m.B4) > 0 { - for _, e := range m.B4 { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *Nested2B) Size() (n int) { +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)) - } - if m.Fee != 0 { - n += 9 + n += 1 + sovUnknonwnproto(uint64(m.Id)) } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.Route) + l = len(m.City) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *Nested1B) Size() (n int) { +func (m *TestVersion4LoneNesting_Inner2) 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.Id) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.Nested != nil { - l = m.Nested.Size() - n += 1 + l + sovProto(uint64(l)) + l = len(m.Country) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.Age != 0 { - n += 1 + sovProto(uint64(m.Age)) + if m.Inner != nil { + l = m.Inner.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *Customer3) Size() (n int) { +func (m *TestVersion4LoneNesting_Inner2_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.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) + l = len(m.Id) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + 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 + sovProto(uint64(l)) + if m.Value != 0 { + n += 1 + sovUnknonwnproto(uint64(m.Value)) } 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) { +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)) + n += 1 + sovUnknonwnproto(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)) - } + 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 + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(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) { +func (m *TestVersionFD1_E) Size() (n int) { if m == nil { return 0 } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } -func (m *TestVersion1_F) Size() (n int) { +func (m *TestVersionFD1_F) Size() (n int) { if m == nil { return 0 } @@ -7176,72 +6300,49 @@ func (m *TestVersion1_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *TestVersion2) Size() (n int) { +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)) + n += 1 + sovUnknonwnproto(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)) - } + 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 + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } if len(m.H) > 0 { for _, e := range m.H { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(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) { +func (m *TestVersionFD1WithExtraAny_E) Size() (n int) { if m == nil { return 0 } var l int _ = l - n += 1 + sovProto(uint64(m.E)) + n += 1 + sovUnknonwnproto(uint64(m.E)) return n } -func (m *TestVersion2_F) Size() (n int) { +func (m *TestVersionFD1WithExtraAny_F) Size() (n int) { if m == nil { return 0 } @@ -7249,1909 +6350,149 @@ func (m *TestVersion2_F) Size() (n int) { _ = l if m.F != nil { l = m.F.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *TestVersion3) Size() (n int) { +func (m *AnyWithExtra) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.X != 0 { - n += 1 + sovProto(uint64(m.X)) + if m.Any != nil { + l = m.Any.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.A != nil { - l = m.A.Size() - n += 1 + l + sovProto(uint64(l)) + if m.B != 0 { + n += 1 + sovUnknonwnproto(uint64(m.B)) } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + if m.C != 0 { + n += 1 + sovUnknonwnproto(uint64(m.C)) } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } + return n +} + +func (m *TestUpdatedTxRaw) Size() (n int) { + if m == nil { + return 0 } - if len(m.D) > 0 { - for _, e := range m.D { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } + var l int + _ = l + l = len(m.BodyBytes) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.Sum != nil { - n += m.Sum.Size() + l = len(m.AuthInfoBytes) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - 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 len(m.Signatures) > 0 { + for _, b := range m.Signatures { + l = len(b) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) + l = len(m.NewField_5) + if l > 0 { + n += 1 + l + sovUnknonwnproto(uint64(l)) } - l = len(m.NonCriticalField) + l = len(m.NewField_1024) if l > 0 { - n += 2 + l + sovProto(uint64(l)) + 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 + 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) { +func (m *TestUpdatedTxBody) 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 { + if len(m.Messages) > 0 { + for _, e := range m.Messages { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } } - if m.Customer1 != nil { - l = m.Customer1.Size() - n += 1 + l + sovProto(uint64(l)) - } - l = len(m.NonCriticalField) + l = len(m.Memo) 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)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } - if m.B != nil { - l = m.B.Size() - n += 1 + l + sovProto(uint64(l)) + if m.TimeoutHeight != 0 { + n += 1 + sovUnknonwnproto(uint64(m.TimeoutHeight)) } - if len(m.C) > 0 { - for _, e := range m.C { - l = e.Size() - n += 1 + l + sovProto(uint64(l)) - } + if m.SomeNewField != 0 { + n += 1 + sovUnknonwnproto(uint64(m.SomeNewField)) } - if len(m.D) > 0 { - for _, e := range m.D { + if len(m.ExtensionOptions) > 0 { + for _, e := range m.ExtensionOptions { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } } - if m.Sum != nil { - n += m.Sum.Size() - } - if m.G != nil { - l = m.G.Size() - n += 1 + l + sovProto(uint64(l)) + l = len(m.SomeNewFieldNonCriticalField) + if l > 0 { + n += 2 + l + sovUnknonwnproto(uint64(l)) } - if len(m.H) > 0 { - for _, e := range m.H { + if len(m.NonCriticalExtensionOptions) > 0 { + for _, e := range m.NonCriticalExtensionOptions { l = e.Size() - n += 1 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(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) { +func (m *TestUpdatedAuthInfo) 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)) + if len(m.SignerInfos) > 0 { + for _, e := range m.SignerInfos { + l = e.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) + } } - return n -} - -func (m *TestVersion3LoneNesting_Inner2_InnerInner) Size() (n int) { - if m == nil { - return 0 + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovUnknonwnproto(uint64(l)) } - var l int - _ = l - l = len(m.Id) + l = len(m.NewField_3) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 1 + l + sovUnknonwnproto(uint64(l)) } - l = len(m.City) + l = len(m.NewField_1024) if l > 0 { - n += 1 + l + sovProto(uint64(l)) + n += 2 + l + sovUnknonwnproto(uint64(l)) } return n } -func (m *TestVersion4LoneNesting) Size() (n int) { +func (m *TestRepeatedUints) 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 len(m.Nums) > 0 { + l = 0 + for _, e := range m.Nums { + l += sovUnknonwnproto(uint64(e)) } - } - 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)) + n += 1 + sovUnknonwnproto(uint64(l)) + 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 sovUnknonwnproto(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } -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 *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 - 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 sozUnknonwnproto(x uint64) (n int) { + return sovUnknonwnproto(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *Customer1) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -9161,7 +6502,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9189,7 +6530,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9208,7 +6549,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9222,11 +6563,11 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9251,7 +6592,7 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9265,11 +6606,11 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9278,15 +6619,15 @@ func (m *Customer1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9308,7 +6649,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9336,7 +6677,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9355,7 +6696,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.Industry = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9374,7 +6715,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9388,11 +6729,11 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9417,7 +6758,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.City = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9436,7 +6777,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9449,11 +6790,11 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9472,7 +6813,7 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { m.Reserved = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9486,15 +6827,15 @@ func (m *Customer2) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9516,7 +6857,7 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9544,7 +6885,7 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9563,7 +6904,7 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9577,11 +6918,11 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9590,15 +6931,15 @@ func (m *Nested4A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9620,7 +6961,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9648,7 +6989,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9667,7 +7008,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9681,11 +7022,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9699,7 +7040,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9712,11 +7053,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9733,7 +7074,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9746,11 +7087,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9765,7 +7106,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9781,7 +7122,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { if fieldNum == 1 { for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9797,7 +7138,7 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9810,11 +7151,11 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { } } if mapmsglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postmsgIndex > l { return io.ErrUnexpectedEOF @@ -9826,12 +7167,12 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { iNdEx = postmsgIndex } else { iNdEx = entryPreIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -9843,15 +7184,15 @@ func (m *Nested3A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -9873,7 +7214,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9901,7 +7242,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9920,7 +7261,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9934,11 +7275,11 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9952,7 +7293,7 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -9965,11 +7306,11 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -9983,15 +7324,15 @@ func (m *Nested2A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10013,7 +7354,7 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10041,7 +7382,7 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10060,7 +7401,7 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10073,11 +7414,11 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10091,15 +7432,15 @@ func (m *Nested1A) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10121,7 +7462,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10149,7 +7490,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10168,7 +7509,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { m.Age = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10187,7 +7528,7 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10201,11 +7542,11 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10214,15 +7555,15 @@ func (m *Nested4B) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10244,7 +7585,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10272,7 +7613,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10291,7 +7632,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { m.Age = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10310,7 +7651,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10324,11 +7665,11 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10342,7 +7683,7 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10355,11 +7696,11 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10371,15 +7712,15 @@ func (m *Nested3B) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10401,7 +7742,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10429,7 +7770,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10459,7 +7800,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10472,11 +7813,11 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10495,7 +7836,7 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10509,11 +7850,11 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10522,15 +7863,15 @@ func (m *Nested2B) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10552,7 +7893,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10580,7 +7921,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10599,7 +7940,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10612,11 +7953,11 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10635,7 +7976,7 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { m.Age = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10649,15 +7990,15 @@ func (m *Nested1B) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10679,7 +8020,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10707,7 +8048,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10726,7 +8067,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10740,11 +8081,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10780,7 +8121,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10794,11 +8135,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10812,7 +8153,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10826,11 +8167,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10844,7 +8185,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10858,11 +8199,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10876,7 +8217,7 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10889,11 +8230,11 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -10907,15 +8248,15 @@ func (m *Customer3) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -10937,7 +8278,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10965,7 +8306,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10984,7 +8325,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -10997,11 +8338,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11020,7 +8361,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11033,11 +8374,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11056,7 +8397,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11069,11 +8410,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11090,7 +8431,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11103,11 +8444,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11124,7 +8465,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11144,7 +8485,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11157,11 +8498,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11179,7 +8520,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11192,11 +8533,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11215,7 +8556,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11228,11 +8569,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11249,7 +8590,7 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11262,11 +8603,11 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11280,15 +8621,15 @@ func (m *TestVersion1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -11310,7 +8651,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11338,7 +8679,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11357,7 +8698,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11370,11 +8711,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11393,7 +8734,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11406,11 +8747,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11429,7 +8770,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11442,11 +8783,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11463,7 +8804,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11476,11 +8817,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11497,7 +8838,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11517,7 +8858,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11530,11 +8871,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11552,7 +8893,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11565,11 +8906,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11588,7 +8929,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11601,11 +8942,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11622,7 +8963,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11635,11 +8976,11 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11658,7 +8999,7 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { m.NewField = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11672,15 +9013,15 @@ func (m *TestVersion2) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -11702,7 +9043,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11730,7 +9071,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11749,7 +9090,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11762,11 +9103,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11785,7 +9126,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11798,11 +9139,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11821,7 +9162,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11834,11 +9175,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11855,7 +9196,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11868,11 +9209,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11889,7 +9230,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11909,7 +9250,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11922,11 +9263,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11944,7 +9285,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11957,11 +9298,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -11980,7 +9321,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -11993,11 +9334,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12014,7 +9355,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12027,11 +9368,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12050,7 +9391,7 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12064,11 +9405,11 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12077,15 +9418,15 @@ func (m *TestVersion3) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -12107,7 +9448,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12135,7 +9476,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12154,7 +9495,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12167,11 +9508,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12190,7 +9531,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12203,11 +9544,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12226,7 +9567,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12239,11 +9580,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12260,7 +9601,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12273,11 +9614,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12294,7 +9635,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12314,7 +9655,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12327,11 +9668,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12350,7 +9691,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12363,11 +9704,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12384,7 +9725,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12397,11 +9738,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12420,7 +9761,7 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12434,11 +9775,11 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12447,15 +9788,15 @@ func (m *TestVersion3LoneOneOfValue) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -12477,7 +9818,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12505,7 +9846,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12524,7 +9865,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12537,11 +9878,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12560,7 +9901,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12573,11 +9914,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12596,7 +9937,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12609,11 +9950,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12630,7 +9971,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12643,11 +9984,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12664,7 +10005,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12677,11 +10018,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12699,7 +10040,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12712,11 +10053,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12735,7 +10076,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12748,11 +10089,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12769,7 +10110,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12782,11 +10123,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12805,7 +10146,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12818,11 +10159,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12841,7 +10182,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12854,11 +10195,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12877,7 +10218,7 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12891,11 +10232,11 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -12904,15 +10245,15 @@ func (m *TestVersion3LoneNesting) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -12934,7 +10275,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12962,7 +10303,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12981,7 +10322,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -12995,11 +10336,11 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13013,7 +10354,7 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13026,11 +10367,11 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13044,15 +10385,15 @@ func (m *TestVersion3LoneNesting_Inner1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13074,7 +10415,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13102,7 +10443,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13116,11 +10457,11 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13134,7 +10475,7 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13148,11 +10489,11 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13161,15 +10502,15 @@ func (m *TestVersion3LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13191,7 +10532,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13219,7 +10560,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13233,11 +10574,11 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13251,7 +10592,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13265,11 +10606,11 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13283,7 +10624,7 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13296,11 +10637,11 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13314,15 +10655,15 @@ func (m *TestVersion3LoneNesting_Inner2) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13344,7 +10685,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13372,7 +10713,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13386,11 +10727,11 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13404,7 +10745,7 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13418,11 +10759,11 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13431,15 +10772,15 @@ func (m *TestVersion3LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13461,7 +10802,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13489,7 +10830,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13508,7 +10849,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13521,11 +10862,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13544,7 +10885,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13557,11 +10898,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13580,7 +10921,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13593,11 +10934,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13614,7 +10955,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13627,11 +10968,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13648,7 +10989,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13661,11 +11002,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13683,7 +11024,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13696,11 +11037,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13719,7 +11060,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13732,11 +11073,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13753,7 +11094,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13766,11 +11107,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13789,7 +11130,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13802,11 +11143,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13825,7 +11166,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13838,11 +11179,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13861,7 +11202,7 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13875,11 +11216,11 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13888,15 +11229,15 @@ func (m *TestVersion4LoneNesting) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -13918,7 +11259,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13946,7 +11287,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13965,7 +11306,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -13979,11 +11320,11 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -13997,7 +11338,7 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14010,11 +11351,11 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14028,15 +11369,15 @@ func (m *TestVersion4LoneNesting_Inner1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14058,7 +11399,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14086,7 +11427,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error m.Id = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14105,7 +11446,7 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14119,11 +11460,11 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14132,15 +11473,15 @@ func (m *TestVersion4LoneNesting_Inner1_InnerInner) Unmarshal(dAtA []byte) error iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14162,7 +11503,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14190,7 +11531,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14204,11 +11545,11 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14222,7 +11563,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14236,11 +11577,11 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14254,7 +11595,7 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14267,11 +11608,11 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14285,15 +11626,15 @@ func (m *TestVersion4LoneNesting_Inner2) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14315,7 +11656,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14343,7 +11684,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14357,11 +11698,11 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14375,7 +11716,7 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error m.Value = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14389,15 +11730,15 @@ func (m *TestVersion4LoneNesting_Inner2_InnerInner) Unmarshal(dAtA []byte) error } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14419,7 +11760,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14447,7 +11788,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14466,7 +11807,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14479,11 +11820,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14502,7 +11843,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14522,7 +11863,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14535,11 +11876,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14557,7 +11898,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14570,11 +11911,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14593,7 +11934,7 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14606,11 +11947,11 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14622,15 +11963,15 @@ func (m *TestVersionFD1) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14652,7 +11993,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14680,7 +12021,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { m.X = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14699,7 +12040,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14712,11 +12053,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14735,7 +12076,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var v int32 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14755,7 +12096,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14768,11 +12109,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14790,7 +12131,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14803,11 +12144,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14826,7 +12167,7 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14839,11 +12180,11 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14855,15 +12196,15 @@ func (m *TestVersionFD1WithExtraAny) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -14885,7 +12226,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14913,7 +12254,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14926,11 +12267,11 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -14949,7 +12290,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { m.B = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14968,7 +12309,7 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { m.C = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -14982,15 +12323,15 @@ func (m *AnyWithExtra) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15012,7 +12353,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15040,7 +12381,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15053,11 +12394,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15074,7 +12415,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15087,11 +12428,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15108,7 +12449,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15121,11 +12462,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15140,7 +12481,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15153,11 +12494,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15174,7 +12515,7 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15187,11 +12528,11 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15203,15 +12544,15 @@ func (m *TestUpdatedTxRaw) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15233,7 +12574,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15261,7 +12602,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15274,11 +12615,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15295,7 +12636,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15309,11 +12650,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15327,7 +12668,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { m.TimeoutHeight = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15346,7 +12687,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { m.SomeNewField = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15365,7 +12706,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15378,11 +12719,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15399,7 +12740,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15413,11 +12754,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15431,7 +12772,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15444,11 +12785,11 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15460,15 +12801,15 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15490,7 +12831,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15518,7 +12859,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15531,11 +12872,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15552,7 +12893,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15565,11 +12906,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15588,7 +12929,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15601,11 +12942,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15622,7 +12963,7 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15635,11 +12976,11 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15651,15 +12992,15 @@ func (m *TestUpdatedAuthInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15681,7 +13022,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15707,7 +13048,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15724,7 +13065,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15737,11 +13078,11 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { } } if packedLen < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } postIndex := iNdEx + packedLen if postIndex < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if postIndex > l { return io.ErrUnexpectedEOF @@ -15761,7 +13102,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { var v uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowProto + return ErrIntOverflowUnknonwnproto } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -15780,15 +13121,15 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipProto(dAtA[iNdEx:]) + skippy, err := skipUnknonwnproto(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) < 0 { - return ErrInvalidLengthProto + return ErrInvalidLengthUnknonwnproto } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -15802,7 +13143,7 @@ func (m *TestRepeatedUints) Unmarshal(dAtA []byte) error { } return nil } -func skipProto(dAtA []byte) (n int, err error) { +func skipUnknonwnproto(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -15810,7 +13151,7 @@ func skipProto(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowProto + return 0, ErrIntOverflowUnknonwnproto } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -15827,7 +13168,7 @@ func skipProto(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowProto + return 0, ErrIntOverflowUnknonwnproto } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -15843,7 +13184,7 @@ func skipProto(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowProto + return 0, ErrIntOverflowUnknonwnproto } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -15856,14 +13197,14 @@ func skipProto(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthProto + return 0, ErrInvalidLengthUnknonwnproto } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProto + return 0, ErrUnexpectedEndOfGroupUnknonwnproto } depth-- case 5: @@ -15872,7 +13213,7 @@ func skipProto(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthProto + return 0, ErrInvalidLengthUnknonwnproto } if depth == 0 { return iNdEx, nil @@ -15882,7 +13223,7 @@ func skipProto(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthProto = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProto = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProto = fmt.Errorf("proto: unexpected end of group") + 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/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)) } diff --git a/types/service_msg.go b/types/service_msg.go new file mode 100644 index 000000000000..61c0f15ab12a --- /dev/null +++ b/types/service_msg.go @@ -0,0 +1,58 @@ +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 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 +} + +// 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{} + +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 +} + +// 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 msg.MethodName +} diff --git a/types/tx/types.go b/types/tx/types.go index b5463c1bcc71..e9066ef41b42 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" @@ -26,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 @@ -138,12 +147,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 isServiceMsg(any.TypeUrl) { + var req sdk.MsgRequest + err := unpacker.UnpackAny(any, &req) + if err != nil { + return err + } + } else { + var msg sdk.Msg + err := unpacker.UnpackAny(any, &msg) + if err != nil { + return err + } } } + return nil } @@ -168,3 +188,9 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterInterface("cosmos.tx.v1beta1.Tx", (*sdk.Tx)(nil)) registry.RegisterImplementations((*sdk.Tx)(nil), &Tx{}) } + +// 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 +} diff --git a/x/auth/ante/testutil_test.go b/x/auth/ante/testutil_test.go index 5ab35b7f19a5..a6755d0c35af 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) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) 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/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 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/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) } 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) { 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{}, 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{}, diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index 9951a8174013..c1108cab32cf 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -1167,584 +1167,582 @@ func (this *Pool) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_ func StakingDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet) { d := &github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet{} var gzipped = []byte{ - // 9223 bytes of a gzipped FileDescriptorSet + // 9197 bytes of a gzipped FileDescriptorSet 0x1f, 0x8b, 0x08, 0x00, 0x00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x0b, 0x2e, 0xe2, 0x06, - 0x76, 0xd0, 0x39, 0x48, 0x6c, 0x6b, 0x0d, 0x9c, 0x93, 0x66, 0xe2, 0x27, 0x32, 0xa7, 0xee, 0x2f, - 0x84, 0x88, 0x0a, 0x41, 0x8a, 0x75, 0x02, 0x56, 0x28, 0x85, 0xfc, 0x7a, 0x02, 0xc6, 0x3b, 0xf4, - 0x22, 0x04, 0x09, 0x5d, 0x6d, 0x12, 0x8e, 0xd2, 0x89, 0xb4, 0x42, 0x7f, 0xa3, 0x1c, 0x0c, 0x9a, - 0x6a, 0xf5, 0xba, 0x5a, 0xc7, 0xb9, 0x18, 0x05, 0x8b, 0x26, 0x9a, 0x02, 0xa8, 0x61, 0x13, 0xeb, - 0x35, 0xac, 0x57, 0xf7, 0x72, 0xf1, 0x99, 0xf8, 0x89, 0xb4, 0xe2, 0x83, 0xa0, 0x87, 0x61, 0xcc, - 0x6c, 0x6d, 0x35, 0xb4, 0x6a, 0xc5, 0x87, 0x06, 0x33, 0xf1, 0x13, 0x49, 0x25, 0xcb, 0x3a, 0x16, - 0x3c, 0xe4, 0x07, 0x61, 0xf4, 0x26, 0x56, 0xaf, 0xfb, 0x51, 0x33, 0x14, 0x75, 0x84, 0x80, 0x7d, - 0x88, 0xf3, 0x30, 0xd4, 0xc4, 0xb6, 0xad, 0xd6, 0x71, 0xc5, 0xd9, 0x33, 0x71, 0x2e, 0x41, 0xb5, - 0x9f, 0x69, 0xd3, 0x3e, 0xac, 0x79, 0x86, 0x53, 0x6d, 0xee, 0x99, 0x18, 0xcd, 0x41, 0x1a, 0xeb, + 0x75, 0x18, 0x67, 0x3f, 0x80, 0xdd, 0xbb, 0x0b, 0x60, 0xf1, 0x00, 0x42, 0xcb, 0x25, 0x09, 0x40, + 0x23, 0x59, 0xa2, 0x28, 0x09, 0x90, 0x28, 0x92, 0x22, 0x97, 0xb1, 0x64, 0x2c, 0xb0, 0x04, 0x41, + 0xe2, 0x4b, 0x03, 0x90, 0xf2, 0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, 0x56, 0x42, 0x23, 0x00, 0x14, 0x70, 0x71, 0x79, 0x6d, - 0x6e, 0x33, 0x1b, 0x73, 0xdb, 0x4b, 0xab, 0x9b, 0x67, 0x4f, 0x67, 0xe3, 0x2e, 0xc1, 0x55, 0x06, - 0x48, 0xf8, 0x11, 0x9e, 0x38, 0x95, 0x4d, 0xa2, 0x2c, 0x0c, 0x31, 0x06, 0x4b, 0xef, 0x2d, 0x2f, - 0x9c, 0x3d, 0x9d, 0x1d, 0x08, 0x42, 0x9e, 0x38, 0x95, 0x1d, 0x44, 0xc3, 0x90, 0xa6, 0x90, 0xd2, - 0xda, 0xda, 0x72, 0x36, 0xe5, 0xf2, 0xdc, 0xd8, 0x54, 0x96, 0x56, 0x17, 0xb3, 0x69, 0x97, 0xe7, - 0xa2, 0xb2, 0x76, 0x75, 0x3d, 0x0b, 0x2e, 0x87, 0x95, 0xf2, 0xc6, 0xc6, 0xdc, 0x62, 0x39, 0x9b, - 0x71, 0x31, 0x4a, 0xef, 0xdb, 0x2c, 0x6f, 0x64, 0x87, 0x02, 0x62, 0x3d, 0x71, 0x2a, 0x3b, 0xec, - 0x0e, 0x51, 0x5e, 0xbd, 0xba, 0x92, 0x1d, 0x41, 0x63, 0x30, 0xcc, 0x86, 0x10, 0x42, 0x8c, 0x86, - 0x40, 0x67, 0x4f, 0x67, 0xb3, 0x9e, 0x20, 0x8c, 0xcb, 0x58, 0x00, 0x70, 0xf6, 0x74, 0x16, 0xc9, - 0xf3, 0x90, 0xa4, 0x6e, 0x88, 0x10, 0x8c, 0x2c, 0xcf, 0x95, 0xca, 0xcb, 0x95, 0xb5, 0xf5, 0xcd, - 0xa5, 0xb5, 0xd5, 0xb9, 0xe5, 0xac, 0xe4, 0xc1, 0x94, 0xf2, 0x33, 0x57, 0x97, 0x94, 0xf2, 0x42, - 0x36, 0xe6, 0x87, 0xad, 0x97, 0xe7, 0x36, 0xcb, 0x0b, 0xd9, 0xb8, 0x5c, 0x85, 0x89, 0x4e, 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 0x39, 0x47, 0xfb, 0xd0, 0x49, 0x18, 0x33, 0xb6, 0x9e, 0xab, 0x32, 0x8f, 0xac, 0x98, - 0x16, 0xde, 0xd6, 0x76, 0x73, 0xf7, 0x53, 0xf3, 0x8e, 0x92, 0x0e, 0xea, 0x8f, 0xeb, 0x14, 0x8c, - 0x1e, 0x82, 0x6c, 0xd5, 0xde, 0x51, 0x2d, 0x93, 0xa6, 0x64, 0xdb, 0x54, 0xab, 0x38, 0xf7, 0x2e, - 0x86, 0xca, 0xe0, 0xab, 0x02, 0x4c, 0x22, 0xc2, 0xbe, 0xa9, 0x6d, 0x3b, 0x82, 0xe3, 0x83, 0x2c, - 0x22, 0x28, 0x8c, 0x73, 0x3b, 0x01, 0x59, 0x62, 0x89, 0xc0, 0xc0, 0x27, 0x28, 0xda, 0x88, 0xb9, - 0x63, 0xfa, 0xc7, 0xbd, 0x0f, 0x86, 0x09, 0xa6, 0x37, 0xe8, 0x43, 0xac, 0x70, 0x33, 0x77, 0x7c, - 0x23, 0x9e, 0x86, 0x49, 0x82, 0xd4, 0xc4, 0x8e, 0x5a, 0x53, 0x1d, 0xd5, 0x87, 0xfd, 0x08, 0xc5, - 0x26, 0x66, 0x5f, 0xe1, 0x9d, 0x01, 0x39, 0xad, 0xd6, 0xd6, 0x9e, 0xeb, 0x58, 0x8f, 0x32, 0x39, - 0x09, 0x4c, 0xb8, 0xd6, 0x5d, 0x2b, 0xce, 0xe5, 0x22, 0x0c, 0xf9, 0xfd, 0x1e, 0xa5, 0x81, 0x79, - 0x7e, 0x56, 0x22, 0x45, 0xd0, 0xfc, 0xda, 0x02, 0x29, 0x5f, 0xde, 0x5f, 0xce, 0xc6, 0x48, 0x19, - 0xb5, 0xbc, 0xb4, 0x59, 0xae, 0x28, 0x57, 0x57, 0x37, 0x97, 0x56, 0xca, 0xd9, 0xb8, 0xaf, 0xb0, - 0xbf, 0x9c, 0x48, 0x3d, 0x90, 0x7d, 0x50, 0x7e, 0x35, 0x06, 0x23,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 0x3a, 0x02, 0x89, 0x86, 0xfa, 0xfc, 0x5e, 0x70, 0xd1, 0xa3, 0xa0, 0x5e, 0x27, 0xe1, 0x08, - 0x24, 0x6e, 0x62, 0xf5, 0x7a, 0x70, 0xa9, 0xa1, 0xa0, 0xbb, 0x18, 0x0c, 0xb3, 0x90, 0xa4, 0xf6, - 0x42, 0x00, 0xdc, 0x62, 0xd9, 0x43, 0x28, 0x05, 0x89, 0xf9, 0x35, 0x85, 0x04, 0x44, 0x16, 0x86, - 0x18, 0xb4, 0xb2, 0xbe, 0x54, 0x9e, 0x2f, 0x67, 0x63, 0xf2, 0x19, 0x18, 0x60, 0x46, 0x20, 0xc1, - 0xe2, 0x9a, 0x21, 0x7b, 0x88, 0x37, 0x39, 0x0f, 0x49, 0xf4, 0x5e, 0x5d, 0x29, 0x95, 0x95, 0x6c, - 0x2c, 0x38, 0xd5, 0x89, 0x6c, 0x52, 0xb6, 0x61, 0xc8, 0x5f, 0x87, 0xbf, 0x3d, 0x9b, 0xf1, 0x6f, - 0x48, 0x90, 0xf1, 0xd5, 0xd5, 0xa4, 0x20, 0x52, 0x1b, 0x0d, 0xe3, 0x66, 0x45, 0x6d, 0x68, 0xaa, - 0xcd, 0x5d, 0x03, 0x28, 0x68, 0x8e, 0x40, 0x7a, 0x9d, 0xba, 0xb7, 0x29, 0x44, 0x92, 0xd9, 0x01, - 0xf9, 0x4b, 0x12, 0x64, 0xc3, 0x85, 0x6d, 0x48, 0x4c, 0xe9, 0x9d, 0x14, 0x53, 0xfe, 0xa2, 0x04, - 0x23, 0xc1, 0x6a, 0x36, 0x24, 0xde, 0xbd, 0xef, 0xa8, 0x78, 0x7f, 0x18, 0x83, 0xe1, 0x40, 0x0d, - 0xdb, 0xab, 0x74, 0x1f, 0x84, 0x31, 0xad, 0x86, 0x9b, 0xa6, 0xe1, 0x60, 0xbd, 0xba, 0x57, 0x69, - 0xe0, 0x1b, 0xb8, 0x91, 0x93, 0x69, 0xd2, 0x98, 0xdd, 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x30, 0x86, 0xf2, 0x20, 0x8c, 0xaa, 0xf5, 0xba, 0x45, 0x98, 0x0b, 0x46, 0x6c, 0x5f, 0x32, 0xe2, - 0x82, 0x29, 0x62, 0xfe, 0x32, 0xa4, 0x84, 0x1d, 0xc8, 0x52, 0x4d, 0x2c, 0x51, 0x31, 0xd9, 0x66, - 0x3b, 0x76, 0x22, 0xad, 0xa4, 0x74, 0xd1, 0x79, 0x2f, 0x0c, 0x69, 0x76, 0xc5, 0x3b, 0xc4, 0x8f, - 0xcd, 0xc4, 0x4e, 0xa4, 0x94, 0x8c, 0x66, 0xbb, 0x07, 0xa0, 0xf2, 0x57, 0x63, 0x30, 0x12, 0x7c, - 0x08, 0x81, 0x16, 0x20, 0xd5, 0x30, 0xaa, 0x2a, 0x75, 0x2d, 0xf6, 0x04, 0xec, 0x44, 0xc4, 0x73, - 0x8b, 0xc2, 0x32, 0xc7, 0x57, 0x5c, 0xca, 0xfc, 0x6f, 0x4b, 0x90, 0x12, 0x60, 0x34, 0x09, 0x09, - 0x53, 0x75, 0x76, 0x28, 0xbb, 0x64, 0x29, 0x96, 0x95, 0x14, 0xda, 0x26, 0x70, 0xdb, 0x54, 0x75, - 0xea, 0x02, 0x1c, 0x4e, 0xda, 0x64, 0x5e, 0x1b, 0x58, 0xad, 0xd1, 0x4d, 0x8f, 0xd1, 0x6c, 0x62, - 0xdd, 0xb1, 0xc5, 0xbc, 0x72, 0xf8, 0x3c, 0x07, 0xa3, 0x87, 0x61, 0xcc, 0xb1, 0x54, 0xad, 0x11, - 0xc0, 0x4d, 0x50, 0xdc, 0xac, 0xe8, 0x70, 0x91, 0x8b, 0x70, 0x44, 0xf0, 0xad, 0x61, 0x47, 0xad, - 0xee, 0xe0, 0x9a, 0x47, 0x34, 0x40, 0x0f, 0x37, 0xee, 0xe1, 0x08, 0x0b, 0xbc, 0x5f, 0xd0, 0xca, - 0xaf, 0x4a, 0x30, 0x26, 0xb6, 0x69, 0x35, 0xd7, 0x58, 0x2b,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d, 0xb8, 0x43, 0x51, 0xf3, 0xac, 0x4b, - 0xef, 0x7f, 0x78, 0xbf, 0xa7, 0x11, 0x54, 0x3d, 0x4f, 0x05, 0xdf, 0xa3, 0x87, 0xa9, 0xf0, 0xa3, - 0x87, 0x67, 0x71, 0xa3, 0x71, 0x45, 0x37, 0x6e, 0xea, 0x9b, 0x01, 0x93, 0xfc, 0x2b, 0x09, 0x66, - 0xe8, 0x85, 0x75, 0xab, 0xa9, 0xe9, 0xce, 0x6c, 0x43, 0xdb, 0xb2, 0x67, 0xb7, 0x34, 0xc7, 0x66, - 0x96, 0xe3, 0x36, 0x99, 0xf0, 0x30, 0x0a, 0x04, 0xa3, 0x40, 0x30, 0xe4, 0xd3, 0x90, 0x2a, 0x69, - 0xce, 0x9c, 0x65, 0xa9, 0x7b, 0x08, 0x41, 0x82, 0xc0, 0xb8, 0x51, 0xe8, 0x6f, 0x62, 0x11, 0xdc, - 0xc0, 0x4d, 0x9b, 0x3e, 0xf4, 0x4a, 0x28, 0xac, 0x51, 0xba, 0xda, 0x75, 0x26, 0x2f, 0xf8, 0x34, - 0xf5, 0x89, 0xe4, 0xfb, 0xc9, 0x22, 0xa1, 0x93, 0xb8, 0xae, 0x3e, 0x5f, 0x4b, 0xc0, 0x71, 0x1f, - 0x42, 0xd5, 0xda, 0x33, 0x1d, 0x1a, 0x92, 0xc6, 0x36, 0x57, 0x66, 0xcc, 0xa7, 0x0c, 0xeb, 0xee, - 0x12, 0x66, 0xdb, 0x90, 0x5c, 0x27, 0x74, 0x44, 0x11, 0xc7, 0x70, 0xd4, 0x06, 0xd7, 0x8e, 0x35, - 0x08, 0x94, 0x5d, 0xda, 0x8f, 0x31, 0xa8, 0x26, 0xee, 0xeb, 0x37, 0xb0, 0xba, 0xcd, 0xee, 0x3e, - 0xc6, 0xe9, 0xb3, 0xcf, 0x14, 0x01, 0xd0, 0x6b, 0x8e, 0x13, 0x90, 0x54, 0x5b, 0xec, 0xb1, 0x5d, - 0xfc, 0x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x53, 0x73, 0x58, 0x75, 0x35, 0x40, - 0xed, 0x3e, 0x42, 0xe0, 0xf3, 0x14, 0x4c, 0x6b, 0xac, 0xa3, 0x90, 0xa6, 0x17, 0xf2, 0x29, 0x0a, - 0xbb, 0x7c, 0x96, 0x22, 0x00, 0xda, 0xf9, 0x20, 0x8c, 0x7a, 0x19, 0x94, 0xa1, 0xa4, 0x18, 0x17, - 0x0f, 0x4c, 0x11, 0x1f, 0x83, 0x09, 0x1d, 0xef, 0xd2, 0xeb, 0x70, 0x01, 0xec, 0x34, 0xc5, 0x46, - 0xa4, 0xef, 0x5a, 0x90, 0xe2, 0x5d, 0x30, 0x52, 0x15, 0xc6, 0x67, 0xb8, 0x40, 0x71, 0x87, 0x5d, - 0x28, 0x45, 0x3b, 0x02, 0x29, 0xd5, 0x34, 0x19, 0x42, 0x86, 0x67, 0x50, 0xd3, 0xa4, 0x5d, 0x27, - 0x61, 0x8c, 0xea, 0x68, 0x61, 0xbb, 0xd5, 0x70, 0x38, 0x93, 0x21, 0x8a, 0x33, 0x4a, 0x3a, 0x14, - 0x06, 0xa7, 0xb8, 0xf7, 0xc1, 0x30, 0xbe, 0xa1, 0xd5, 0xb0, 0x5e, 0xc5, 0x0c, 0x6f, 0x98, 0xe2, - 0x0d, 0x09, 0x20, 0x45, 0x7a, 0x08, 0xdc, 0xcc, 0x58, 0x11, 0x59, 0x7b, 0x84, 0xf1, 0x13, 0xf0, - 0x39, 0x06, 0x96, 0x1f, 0x81, 0xc4, 0x82, 0xea, 0xa8, 0xa4, 0xc4, 0x70, 0x76, 0xd9, 0x52, 0x34, - 0xa4, 0x90, 0x9f, 0x1d, 0xc3, 0xed, 0x8d, 0x18, 0x24, 0xae, 0x19, 0x0e, 0x46, 0x4f, 0xf8, 0xca, - 0xc2, 0x91, 0x4e, 0x3e, 0xbe, 0xa1, 0xd5, 0x75, 0x5c, 0x5b, 0xb1, 0xeb, 0xbe, 0x37, 0x6a, 0x3d, - 0x17, 0x8b, 0x05,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, 0x73, 0x0b, 0xcb, 0xdd, 0x2d, 0x2c, 0xc8, 0xb8, 0x95, 0x5d, 0x4a, 0xf9, 0x4f, 0x25, 0x00, - 0xcf, 0x67, 0x7f, 0x30, 0x5d, 0x8c, 0xa4, 0x72, 0x9e, 0x78, 0xe3, 0x07, 0xaa, 0xc5, 0x38, 0x75, - 0xc8, 0x9e, 0x3f, 0x1e, 0x83, 0xf1, 0xab, 0x22, 0xf3, 0xfc, 0xc0, 0xdb, 0x60, 0x1d, 0x06, 0xb1, - 0xee, 0x58, 0x1a, 0x35, 0x02, 0x99, 0xed, 0xc7, 0xba, 0xcd, 0x76, 0x07, 0x9d, 0xe8, 0x17, 0x55, - 0xc4, 0x33, 0x09, 0xce, 0x26, 0x64, 0x8d, 0x4f, 0xc5, 0x21, 0xd7, 0x8d, 0x12, 0xcd, 0xc3, 0x68, - 0xd5, 0xc2, 0x14, 0x50, 0xf1, 0x1f, 0x82, 0x96, 0xf2, 0x5e, 0xe9, 0x18, 0x42, 0x90, 0x95, 0x11, - 0x01, 0xe1, 0xab, 0x47, 0x1d, 0x48, 0x5d, 0x47, 0xdc, 0x8e, 0x60, 0xf5, 0x58, 0xc8, 0xc9, 0x7c, - 0xf9, 0x10, 0x83, 0x04, 0x19, 0xb0, 0xf5, 0x63, 0xc4, 0x83, 0xd2, 0x05, 0xe4, 0x83, 0x30, 0xaa, - 0xe9, 0x9a, 0xa3, 0xa9, 0x8d, 0xca, 0x96, 0xda, 0x50, 0xf5, 0xea, 0x41, 0xca, 0x62, 0x96, 0xf2, - 0xf9, 0xb0, 0x21, 0x76, 0xb2, 0x32, 0xc2, 0x21, 0x25, 0x06, 0x40, 0x97, 0x60, 0x50, 0x0c, 0x95, - 0x38, 0x50, 0xb5, 0x21, 0xc8, 0xfd, 0x15, 0x5c, 0x1c, 0xc6, 0x14, 0x5c, 0xfb, 0xff, 0x53, 0xd1, - 0xdf, 0x54, 0xac, 0x00, 0xb0, 0x70, 0x27, 0x09, 0xf6, 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0x82, 0xab, 0x0c, 0x90, 0xf0, 0x23, 0x3c, 0x71, + 0x2a, 0x97, 0x44, 0x39, 0xc8, 0x32, 0x06, 0x4b, 0xef, 0x2d, 0x2f, 0x9c, 0x3d, 0x9d, 0x1b, 0x08, + 0x42, 0x9e, 0x38, 0x95, 0x1b, 0x44, 0x43, 0x90, 0xa6, 0x90, 0xd2, 0xda, 0xda, 0x72, 0x2e, 0xe5, + 0xf2, 0xdc, 0xd8, 0x54, 0x96, 0x56, 0x17, 0x73, 0x69, 0x97, 0xe7, 0xa2, 0xb2, 0x76, 0x75, 0x3d, + 0x07, 0x2e, 0x87, 0x95, 0xf2, 0xc6, 0xc6, 0xdc, 0x62, 0x39, 0x97, 0x71, 0x31, 0x4a, 0xef, 0xdb, + 0x2c, 0x6f, 0xe4, 0xb2, 0x01, 0xb1, 0x9e, 0x38, 0x95, 0x1b, 0x72, 0x87, 0x28, 0xaf, 0x5e, 0x5d, + 0xc9, 0x0d, 0xa3, 0x51, 0x18, 0x62, 0x43, 0x08, 0x21, 0x46, 0x42, 0xa0, 0xb3, 0xa7, 0x73, 0x39, + 0x4f, 0x10, 0xc6, 0x65, 0x34, 0x00, 0x38, 0x7b, 0x3a, 0x87, 0xe4, 0x79, 0x48, 0x52, 0xef, 0x42, + 0x08, 0x86, 0x97, 0xe7, 0x4a, 0xe5, 0xe5, 0xca, 0xda, 0xfa, 0xe6, 0xd2, 0xda, 0xea, 0xdc, 0x72, + 0x4e, 0xf2, 0x60, 0x4a, 0xf9, 0x99, 0xab, 0x4b, 0x4a, 0x79, 0x21, 0x17, 0xf3, 0xc3, 0xd6, 0xcb, + 0x73, 0x9b, 0xe5, 0x85, 0x5c, 0x5c, 0xae, 0xc2, 0x78, 0xa7, 0x3c, 0xd9, 0x31, 0x32, 0x7c, 0x53, + 0x1c, 0xeb, 0x32, 0xc5, 0x94, 0x57, 0xdb, 0x14, 0x7f, 0x3b, 0x06, 0x63, 0x1d, 0xd6, 0x8a, 0x8e, + 0x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x75, 0x0a, 0x46, 0x0f, 0x41, 0xae, 0x6a, 0xef, 0xa8, 0x96, 0x49, 0x73, 0xb2, + 0x6d, 0xaa, 0x55, 0x9c, 0x7f, 0x17, 0x43, 0x65, 0xf0, 0x55, 0x01, 0x26, 0x21, 0x61, 0xdf, 0xd4, + 0xb6, 0x1d, 0xc1, 0xf1, 0x41, 0x16, 0x12, 0x14, 0xc6, 0xb9, 0x9d, 0x80, 0x1c, 0x31, 0x45, 0x60, + 0xe0, 0x13, 0x14, 0x6d, 0xd8, 0xdc, 0x31, 0xfd, 0xe3, 0xde, 0x07, 0x43, 0x04, 0xd3, 0x1b, 0xf4, + 0x21, 0x56, 0x90, 0x99, 0x3b, 0xbe, 0x11, 0x4f, 0xc3, 0x04, 0x41, 0x6a, 0x62, 0x47, 0xad, 0xa9, + 0x8e, 0xea, 0xc3, 0x7e, 0x84, 0x62, 0x13, 0xbb, 0xaf, 0xf0, 0xce, 0x80, 0x9c, 0x56, 0x6b, 0x6b, + 0xcf, 0xf5, 0xac, 0x47, 0x99, 0x9c, 0x04, 0x26, 0x7c, 0xeb, 0xae, 0x15, 0xdd, 0x72, 0x11, 0xb2, + 0x7e, 0xc7, 0x47, 0x69, 0x60, 0xae, 0x9f, 0x93, 0x48, 0x15, 0x34, 0xbf, 0xb6, 0x40, 0xea, 0x97, + 0xf7, 0x97, 0x73, 0x31, 0x52, 0x47, 0x2d, 0x2f, 0x6d, 0x96, 0x2b, 0xca, 0xd5, 0xd5, 0xcd, 0xa5, + 0x95, 0x72, 0x2e, 0xee, 0x2b, 0xd8, 0x2f, 0x27, 0x52, 0x0f, 0xe4, 0x1e, 0x94, 0x5f, 0x8d, 0xc1, + 0x70, 0x70, 0x07, 0x86, 0x7e, 0x08, 0xee, 0x11, 0xc7, 0x25, 0x36, 0x76, 0x2a, 0x37, 0x35, 0x8b, + 0x46, 0x64, 0x53, 0x65, 0xab, 0xa3, 0xeb, 0x13, 0xe3, 0x1c, 0x6b, 0x03, 0x3b,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x59, + 0xfd, 0x83, 0xef, 0x06, 0x8b, 0x30, 0xc5, 0x47, 0x4a, 0x32, 0x11, 0x3f, 0x76, 0xa5, 0xbb, 0xa8, + 0x68, 0xc1, 0x7e, 0x5d, 0x64, 0x22, 0x1f, 0x19, 0x91, 0xcd, 0x57, 0x21, 0x12, 0xb3, 0x57, 0xc9, + 0xde, 0xa1, 0x07, 0x76, 0xff, 0x30, 0x24, 0xdc, 0x86, 0xa0, 0x25, 0x3c, 0x7d, 0xf5, 0x4f, 0x4b, + 0xbf, 0x8e, 0xf7, 0x7a, 0xf2, 0xce, 0x7f, 0x14, 0xaa, 0x7f, 0xae, 0x32, 0x4a, 0x96, 0x43, 0x46, + 0x42, 0xf5, 0x14, 0x8a, 0xba, 0x3f, 0x94, 0xff, 0xd1, 0x37, 0xb9, 0xbe, 0xc1, 0x72, 0xaa, 0xb8, + 0x4c, 0x9c, 0x3c, 0x58, 0xf4, 0x44, 0x33, 0xfb, 0xe8, 0x9b, 0xae, 0x9f, 0x07, 0x6a, 0x9e, 0xe2, + 0x45, 0x18, 0x0a, 0x14, 0x3c, 0xd1, 0xac, 0x3e, 0xc6, 0x59, 0x65, 0xfd, 0xf5, 0x4e, 0xf1, 0x0c, + 0x24, 0x48, 0xf1, 0x12, 0x4d, 0xfe, 0x97, 0x39, 0x39, 0x45, 0x2f, 0xbe, 0x1b, 0x52, 0xa2, 0x68, + 0x89, 0x26, 0xfd, 0x38, 0x27, 0x75, 0x49, 0x08, 0xb9, 0x28, 0x58, 0xa2, 0xc9, 0xff, 0x8a, 0x20, + 0x17, 0x24, 0x84, 0xbc, 0x77, 0x13, 0x7e, 0xf3, 0xc7, 0x13, 0x7c, 0xd1, 0x11, 0xb6, 0xbb, 0x00, + 0x83, 0xbc, 0x52, 0x89, 0xa6, 0xfe, 0x24, 0x1f, 0x5c, 0x50, 0x14, 0x9f, 0x84, 0x64, 0x8f, 0x06, + 0xff, 0x09, 0x4e, 0xca, 0xf0, 0x8b, 0xf3, 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xf1, 0xd2, 0x82, 0x2b, 0x88, 0xe4, 0x09, 0x82, 0x56, 0x60, + 0xc4, 0x54, 0x2d, 0x87, 0x5e, 0x80, 0xde, 0xa1, 0x5a, 0xf0, 0x68, 0x98, 0x6a, 0x8f, 0xcd, 0x80, + 0xb2, 0x7c, 0x94, 0x21, 0xd3, 0x0f, 0x94, 0xff, 0x38, 0x01, 0x03, 0xdc, 0x18, 0xef, 0x86, 0x41, + 0x6e, 0x56, 0xee, 0xbf, 0xc7, 0x67, 0xda, 0x97, 0xa6, 0x19, 0x77, 0x09, 0xe1, 0xfc, 0x04, 0x0d, + 0x7a, 0x00, 0x52, 0xd5, 0x1d, 0x55, 0xd3, 0x2b, 0x5a, 0x4d, 0xd4, 0xf2, 0xaf, 0xdd, 0x9a, 0x1a, + 0x9c, 0x27, 0xb0, 0xa5, 0x05, 0x65, 0x90, 0x76, 0x2e, 0xd5, 0x48, 0x2d, 0xb0, 0x83, 0xb5, 0xfa, + 0x8e, 0xc3, 0x63, 0x90, 0xb7, 0xd0, 0x39, 0x48, 0x10, 0x97, 0xe1, 0xef, 0xc7, 0x14, 0xda, 0xf6, + 0x58, 0x6e, 0xdd, 0x5a, 0x4a, 0x91, 0x81, 0x3f, 0xfd, 0x87, 0x53, 0x92, 0x42, 0x29, 0xd0, 0x3c, + 0x0c, 0x35, 0x54, 0xdb, 0xa9, 0xd0, 0x35, 0x8c, 0x0c, 0x9f, 0xa4, 0x2c, 0x8e, 0xb4, 0x1b, 0x84, + 0x1b, 0x96, 0x8b, 0x9e, 0x21, 0x54, 0x0c, 0x54, 0x43, 0x27, 0x20, 0x47, 0x99, 0x54, 0x8d, 0x66, + 0x53, 0x73, 0x58, 0x75, 0x35, 0x40, 0xed, 0x3e, 0x4c, 0xe0, 0xf3, 0x14, 0x4c, 0x6b, 0xac, 0xa3, + 0x90, 0xa6, 0x17, 0xf2, 0x29, 0x0a, 0xbb, 0x7c, 0x96, 0x22, 0x00, 0xda, 0xf9, 0x20, 0x8c, 0x78, + 0x19, 0x94, 0xa1, 0xa4, 0x18, 0x17, 0x0f, 0x4c, 0x11, 0x1f, 0x83, 0x71, 0x1d, 0xef, 0xd2, 0xeb, + 0x70, 0x01, 0xec, 0x34, 0xc5, 0x46, 0xa4, 0xef, 0x5a, 0x90, 0xe2, 0x5d, 0x30, 0x5c, 0x15, 0xc6, + 0x67, 0xb8, 0x40, 0x71, 0x87, 0x5c, 0x28, 0x45, 0x3b, 0x02, 0x29, 0xd5, 0x34, 0x19, 0x42, 0x86, + 0x67, 0x50, 0xd3, 0xa4, 0x5d, 0x27, 0x61, 0x94, 0xea, 0x68, 0x61, 0xbb, 0xd5, 0x70, 0x38, 0x93, + 0x2c, 0xc5, 0x19, 0x21, 0x1d, 0x0a, 0x83, 0x53, 0xdc, 0xfb, 0x60, 0x08, 0xdf, 0xd0, 0x6a, 0x58, + 0xaf, 0x62, 0x86, 0x37, 0x44, 0xf1, 0xb2, 0x02, 0x48, 0x91, 0x1e, 0x02, 0x37, 0x33, 0x56, 0x44, + 0xd6, 0x1e, 0x66, 0xfc, 0x04, 0x7c, 0x8e, 0x81, 0xe5, 0x47, 0x20, 0xb1, 0xa0, 0x3a, 0x2a, 0x29, + 0x31, 0x9c, 0x5d, 0xb6, 0x14, 0x65, 0x15, 0xf2, 0xb3, 0x63, 0xb8, 0xbd, 0x11, 0x83, 0xc4, 0x35, + 0xc3, 0xc1, 0xe8, 0x09, 0x5f, 0x59, 0x38, 0xdc, 0xc9, 0xc7, 0x37, 0xb4, 0xba, 0x8e, 0x6b, 0x2b, + 0x76, 0xdd, 0xf7, 0xa6, 0xac, 0xe7, 0x62, 0xb1, 0x80, 0x8b, 0x8d, 0x43, 0xd2, 0x32, 0x5a, 0x7a, + 0x4d, 0xdc, 0xe5, 0xa2, 0x0d, 0x54, 0x86, 0x94, 0xeb, 0x39, 0x89, 0x28, 0xcf, 0x19, 0x21, 0x9e, + 0x43, 0xfc, 0x9a, 0x03, 0x94, 0xc1, 0x2d, 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0xeb, 0x57, 0xf5, 0xda, + 0xff, 0xeb, 0xbe, 0x73, 0xc7, 0x97, 0xf0, 0x7f, 0x16, 0x83, 0x93, 0xfe, 0x35, 0xf7, 0x83, 0x2d, + 0x6c, 0xed, 0xb9, 0xcb, 0xaa, 0xa9, 0xd6, 0x35, 0xdd, 0xff, 0x14, 0xfb, 0x88, 0x5f, 0x60, 0x8a, + 0x2b, 0xc4, 0x96, 0x75, 0xc8, 0xac, 0xab, 0x75, 0xac, 0xe0, 0x0f, 0xb6, 0xb0, 0xed, 0x74, 0x78, + 0x37, 0x65, 0x02, 0x06, 0x8c, 0xed, 0x6d, 0x71, 0x45, 0x25, 0xa1, 0xf0, 0x16, 0x1a, 0x87, 0x64, + 0x43, 0x6b, 0x6a, 0xcc, 0x28, 0x09, 0x85, 0x35, 0xd0, 0x14, 0x64, 0xaa, 0x44, 0xf7, 0x0a, 0xbb, + 0xd3, 0x9b, 0x10, 0xdf, 0xde, 0x68, 0xe9, 0xce, 0x26, 0x81, 0xc8, 0x4f, 0x43, 0x96, 0x8d, 0xc7, + 0xeb, 0xd0, 0x23, 0x90, 0xa2, 0x77, 0x30, 0xbd, 0x51, 0x07, 0x49, 0xfb, 0x0a, 0x7b, 0x8f, 0x85, + 0x71, 0x61, 0x03, 0xb3, 0x46, 0xa9, 0xd4, 0xd5, 0x94, 0x27, 0xa2, 0x93, 0x1d, 0x33, 0x94, 0x6b, + 0xc6, 0xdf, 0x4c, 0xc2, 0x61, 0xfe, 0x78, 0x59, 0x35, 0xb5, 0xd9, 0x1d, 0xc7, 0x11, 0x2f, 0x88, + 0x01, 0xdf, 0x00, 0xaa, 0xa6, 0x26, 0xef, 0x41, 0xe2, 0x92, 0xe3, 0x98, 0xe8, 0x24, 0x24, 0xad, + 0x56, 0x03, 0x8b, 0x73, 0xd0, 0xf1, 0x19, 0x0f, 0x67, 0x86, 0x20, 0x28, 0xad, 0x06, 0x56, 0x18, + 0x0a, 0x2a, 0xc3, 0xd4, 0x76, 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, 0x77, 0x5c, 0x04, 0xe9, 0x7f, 0x23, 0xec, 0xf3, 0x90, 0x2e, 0x64, + 0x9c, 0x8e, 0x7c, 0x65, 0x65, 0xbc, 0xd5, 0xa9, 0x9a, 0x58, 0x87, 0xa1, 0xc0, 0x02, 0x96, 0x17, + 0xff, 0x53, 0xb4, 0xf7, 0xeb, 0xcd, 0x41, 0x06, 0xa8, 0x00, 0x29, 0xbc, 0x6b, 0x1a, 0x96, 0x83, + 0x6b, 0xf4, 0xca, 0x43, 0x4a, 0x71, 0xdb, 0xf2, 0x2a, 0xa0, 0xf6, 0xc9, 0x0d, 0x7f, 0x45, 0x31, + 0xed, 0x7d, 0x45, 0x71, 0x1c, 0x92, 0xfe, 0xef, 0x0c, 0xb2, 0xc6, 0xdd, 0xbb, 0x2d, 0xf4, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0x67, 0xcd, 0x4f, 0x75, 0x24, 0x8e, 0x00, 0x00, } r := bytes.NewReader(gzipped) gzipr, err := compress_gzip.NewReader(r) From b706d8dc641664ee2494a40f505cd95afff9755e Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Tue, 13 Oct 2020 05:05:46 -0400 Subject: [PATCH 03/12] Refactor x/bank according to ADR 031 (#7520) * Refactor x/bank according to ADR 031 * Add comment * Update comment * Add comment * Add tests, address edge cases * Imports Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- buf.yaml | 1 + proto/cosmos/bank/v1beta1/tx.proto | 15 + types/result.go | 30 ++ types/result_test.go | 35 +++ x/bank/handler.go | 89 +----- x/bank/keeper/msg_server.go | 104 +++++++ x/bank/types/tx.pb.go | 421 +++++++++++++++++++++++++++-- 7 files changed, 586 insertions(+), 109 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/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/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,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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, 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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 de4dfe0906a6268916a1fe53fbeb0162151f7ef0 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Fri, 16 Oct 2020 18:34:02 +0530 Subject: [PATCH 04/12] Refactor x/{gov, crisis} according to ADR 031 (#7533) * Refactor x/gov according to ADR 31 * fix tests * Refactor x/crisis according to ADR 031 * fix lint * lint * lint * review changes * lint * review change * fic doc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/crisis/v1beta1/tx.proto | 9 + proto/cosmos/gov/v1beta1/tx.proto | 37 +- x/crisis/handler.go | 73 +-- x/crisis/keeper/msg_server.go | 78 ++++ x/crisis/types/tx.pb.go | 226 +++++++++- x/gov/abci_test.go | 13 +- x/gov/handler.go | 124 +----- x/gov/keeper/msg_server.go | 128 ++++++ x/gov/types/msgs.go | 19 +- x/gov/types/tx.pb.go | 642 +++++++++++++++++++++++++-- 10 files changed, 1099 insertions(+), 250 deletions(-) create mode 100644 x/crisis/keeper/msg_server.go create mode 100644 x/gov/keeper/msg_server.go diff --git a/proto/cosmos/crisis/v1beta1/tx.proto b/proto/cosmos/crisis/v1beta1/tx.proto index 5c77a6a491ab..c6156b8a72dc 100644 --- a/proto/cosmos/crisis/v1beta1/tx.proto +++ b/proto/cosmos/crisis/v1beta1/tx.proto @@ -5,6 +5,12 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; import "gogoproto/gogo.proto"; +// Msg defines the bank Msg service. +service Msg { + // VerifyInvariant defines a method to verify a particular invariance. + rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); +} + // MsgVerifyInvariant represents a message to verify a particular invariance. message MsgVerifyInvariant { option (gogoproto.equal) = false; @@ -14,3 +20,6 @@ message MsgVerifyInvariant { string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""]; string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""]; } + +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +message MsgVerifyInvariantResponse { } diff --git a/proto/cosmos/gov/v1beta1/tx.proto b/proto/cosmos/gov/v1beta1/tx.proto index 01e3bf2be058..5c0560757d24 100644 --- a/proto/cosmos/gov/v1beta1/tx.proto +++ b/proto/cosmos/gov/v1beta1/tx.proto @@ -8,14 +8,26 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; + +// Msg defines the bank Msg service. +service Msg { + // SubmitProposal defines a method to create new proposal given a content. + rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); + + // Vote defines a method to add a vote on a specific proposal. + rpc Vote(MsgVote) returns (MsgVoteResponse); + + // Deposit defines a method to add deposit on a specific proposal. + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); +} // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary // proposal Content. message MsgSubmitProposal { option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ @@ -26,21 +38,38 @@ message MsgSubmitProposal { string proposer = 3; } +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +message MsgSubmitProposalResponse { + uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; +} + // MsgVote defines a message to cast a vote. message MsgVote { option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; string voter = 2; VoteOption option = 3; } +// MsgVoteResponse defines the Msg/Vote response type. +message MsgVoteResponse {} + // MsgDeposit defines a message to submit a deposit to an existing proposal. message MsgDeposit { option (gogoproto.equal) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.stringer) = false; + option (gogoproto.goproto_getters) = false; uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; string depositor = 2; repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} \ No newline at end of file +} + +// MsgDepositResponse defines the Msg/Deposit response type. +message MsgDepositResponse {} diff --git a/x/crisis/handler.go b/x/crisis/handler.go index eee27a95c11a..0e6cf985f877 100644 --- a/x/crisis/handler.go +++ b/x/crisis/handler.go @@ -3,90 +3,23 @@ package crisis import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/crisis/keeper" "github.com/cosmos/cosmos-sdk/x/crisis/types" ) // RouterKey const RouterKey = types.ModuleName -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k types.MsgServer) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgVerifyInvariant: - return handleMsgVerifyInvariant(ctx, msg, k) + res, err := k.VerifyInvariant(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized crisis message type: %T", msg) } } } - -func handleMsgVerifyInvariant(ctx sdk.Context, msg *types.MsgVerifyInvariant, k keeper.Keeper) (*sdk.Result, error) { - constantFee := sdk.NewCoins(k.GetConstantFee(ctx)) - - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } - if err := k.SendCoinsFromAccountToFeeCollector(ctx, sender, constantFee); err != nil { - return nil, err - } - - // use a cached context to avoid gas costs during invariants - cacheCtx, _ := ctx.CacheContext() - - found := false - msgFullRoute := msg.FullInvariantRoute() - - var res string - var stop bool - for _, invarRoute := range k.Routes() { - if invarRoute.FullRoute() == msgFullRoute { - res, stop = invarRoute.Invar(cacheCtx) - found = true - - break - } - } - - if !found { - return nil, types.ErrUnknownInvariant - } - - if stop { - // NOTE currently, because the chain halts here, this transaction will never be included - // in the blockchain thus the constant fee will have never been deducted. Thus no - // refund is required. - - // TODO uncomment the following code block with implementation of the circuit breaker - //// refund constant fee - //err := k.distrKeeper.DistributeFromFeePool(ctx, constantFee, msg.Sender) - //if err != nil { - //// if there are insufficient coins to refund, log the error, - //// but still halt the chain. - //logger := ctx.Logger().With("module", "x/crisis") - //logger.Error(fmt.Sprintf( - //"WARNING: insufficient funds to allocate to sender from fee pool, err: %s", err)) - //} - - // TODO replace with circuit breaker - panic(res) - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeInvariant, - sdk.NewAttribute(types.AttributeKeyRoute, msg.InvariantRoute), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCrisis), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/crisis/keeper/msg_server.go b/x/crisis/keeper/msg_server.go new file mode 100644 index 000000000000..304f8b17243d --- /dev/null +++ b/x/crisis/keeper/msg_server.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/crisis/types" +) + +var _ types.MsgServer = Keeper{} + +func (k Keeper) VerifyInvariant(goCtx context.Context, msg *types.MsgVerifyInvariant) (*types.MsgVerifyInvariantResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + constantFee := sdk.NewCoins(k.GetConstantFee(ctx)) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + if err := k.SendCoinsFromAccountToFeeCollector(ctx, sender, constantFee); err != nil { + return nil, err + } + + // use a cached context to avoid gas costs during invariants + cacheCtx, _ := ctx.CacheContext() + + found := false + msgFullRoute := msg.FullInvariantRoute() + + var res string + var stop bool + for _, invarRoute := range k.Routes() { + if invarRoute.FullRoute() == msgFullRoute { + res, stop = invarRoute.Invar(cacheCtx) + found = true + + break + } + } + + if !found { + return nil, types.ErrUnknownInvariant + } + + if stop { + // NOTE currently, because the chain halts here, this transaction will never be included + // in the blockchain thus the constant fee will have never been deducted. Thus no + // refund is required. + + // TODO uncomment the following code block with implementation of the circuit breaker + //// refund constant fee + //err := k.distrKeeper.DistributeFromFeePool(ctx, constantFee, msg.Sender) + //if err != nil { + //// if there are insufficient coins to refund, log the error, + //// but still halt the chain. + //logger := ctx.Logger().With("module", "x/crisis") + //logger.Error(fmt.Sprintf( + //"WARNING: insufficient funds to allocate to sender from fee pool, err: %s", err)) + //} + + // TODO replace with circuit breaker + panic(res) + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeInvariant, + sdk.NewAttribute(types.AttributeKeyRoute, msg.InvariantRoute), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCrisis), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + ), + }) + + return &types.MsgVerifyInvariantResponse{}, nil +} diff --git a/x/crisis/types/tx.pb.go b/x/crisis/types/tx.pb.go index 64102a50d06c..7fed79516c1c 100644 --- a/x/crisis/types/tx.pb.go +++ b/x/crisis/types/tx.pb.go @@ -4,9 +4,14 @@ package types 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" @@ -63,14 +68,52 @@ func (m *MsgVerifyInvariant) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVerifyInvariant proto.InternalMessageInfo +// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +type MsgVerifyInvariantResponse struct { +} + +func (m *MsgVerifyInvariantResponse) Reset() { *m = MsgVerifyInvariantResponse{} } +func (m *MsgVerifyInvariantResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVerifyInvariantResponse) ProtoMessage() {} +func (*MsgVerifyInvariantResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_61276163172fe867, []int{1} +} +func (m *MsgVerifyInvariantResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVerifyInvariantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVerifyInvariantResponse.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 *MsgVerifyInvariantResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVerifyInvariantResponse.Merge(m, src) +} +func (m *MsgVerifyInvariantResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVerifyInvariantResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVerifyInvariantResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVerifyInvariantResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgVerifyInvariant)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariant") + proto.RegisterType((*MsgVerifyInvariantResponse)(nil), "cosmos.crisis.v1beta1.MsgVerifyInvariantResponse") } func init() { proto.RegisterFile("cosmos/crisis/v1beta1/tx.proto", fileDescriptor_61276163172fe867) } var fileDescriptor_61276163172fe867 = []byte{ - // 276 bytes of a gzipped FileDescriptorProto + // 318 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2e, 0xca, 0x2c, 0xce, 0x2c, 0xd6, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0xc8, 0xeb, 0x41, @@ -83,12 +126,96 @@ var fileDescriptor_61276163172fe867 = []byte{ 0x94, 0x82, 0x84, 0xe1, 0xe2, 0xbe, 0x60, 0x61, 0xbf, 0xc4, 0xdc, 0x54, 0x21, 0x67, 0x2e, 0x7e, 0x84, 0xf2, 0xa2, 0xfc, 0xd2, 0x92, 0x54, 0x09, 0x66, 0xb0, 0x79, 0x52, 0x9f, 0xee, 0xc9, 0x8b, 0xa1, 0x9b, 0x07, 0x56, 0xa0, 0x14, 0xc4, 0x07, 0x17, 0x09, 0x02, 0x09, 0x58, 0x71, 0x74, 0x2c, - 0x90, 0x67, 0x78, 0xb1, 0x40, 0x9e, 0xc1, 0xc9, 0xf5, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0xb4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x61, - 0xa1, 0x08, 0xa6, 0x74, 0x8b, 0x53, 0xb2, 0xf5, 0x2b, 0x60, 0x41, 0x5a, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0x0e, 0x21, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x29, 0x57, 0x7a, 0x12, - 0x70, 0x01, 0x00, 0x00, + 0x90, 0x67, 0x78, 0xb1, 0x40, 0x9e, 0x41, 0x49, 0x86, 0x4b, 0x0a, 0xd3, 0x4b, 0x41, 0xa9, 0xc5, + 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x46, 0x65, 0x5c, 0xcc, 0xbe, 0xc5, 0xe9, 0x42, 0xf9, 0x5c, 0xfc, + 0xe8, 0x9e, 0xd6, 0xd4, 0xc3, 0x1a, 0x72, 0x7a, 0x98, 0x86, 0x49, 0x19, 0x12, 0xad, 0x14, 0x66, + 0xaf, 0x93, 0xeb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, + 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x69, 0xa7, 0x67, + 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xc3, 0xe2, 0x16, 0x4c, 0xe9, 0x16, 0xa7, + 0x64, 0xeb, 0x57, 0xc0, 0x22, 0xba, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0x6f, 0xc6, + 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x60, 0x68, 0x5a, 0x06, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // VerifyInvariant defines a method to verify a particular invariance. + VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) VerifyInvariant(ctx context.Context, in *MsgVerifyInvariant, opts ...grpc.CallOption) (*MsgVerifyInvariantResponse, error) { + out := new(MsgVerifyInvariantResponse) + err := c.cc.Invoke(ctx, "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // VerifyInvariant defines a method to verify a particular invariance. + VerifyInvariant(context.Context, *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) VerifyInvariant(ctx context.Context, req *MsgVerifyInvariant) (*MsgVerifyInvariantResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyInvariant not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_VerifyInvariant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVerifyInvariant) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).VerifyInvariant(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.crisis.v1beta1.Msg/VerifyInvariant", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).VerifyInvariant(ctx, req.(*MsgVerifyInvariant)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.crisis.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "VerifyInvariant", + Handler: _Msg_VerifyInvariant_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/crisis/v1beta1/tx.proto", } func (m *MsgVerifyInvariant) Marshal() (dAtA []byte, err error) { @@ -135,6 +262,29 @@ func (m *MsgVerifyInvariant) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgVerifyInvariantResponse) 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 *MsgVerifyInvariantResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVerifyInvariantResponse) 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 @@ -167,6 +317,15 @@ func (m *MsgVerifyInvariant) Size() (n int) { return n } +func (m *MsgVerifyInvariantResponse) 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 } @@ -322,6 +481,59 @@ func (m *MsgVerifyInvariant) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgVerifyInvariantResponse) 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: MsgVerifyInvariantResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVerifyInvariantResponse: 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 diff --git a/x/gov/abci_test.go b/x/gov/abci_test.go index bfe5ceac544c..70a172ee1b7a 100644 --- a/x/gov/abci_test.go +++ b/x/gov/abci_test.go @@ -4,6 +4,7 @@ import ( "testing" "time" + "github.com/golang/protobuf/proto" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -172,7 +173,11 @@ func TestTickPassedDepositPeriod(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - proposalID := types.GetProposalIDFromBytes(res.Data) + var proposalData types.MsgSubmitProposalResponse + err = proto.Unmarshal(res.Data, &proposalData) + require.NoError(t, err) + + proposalID := proposalData.ProposalId inactiveQueue = app.GovKeeper.InactiveProposalQueueIterator(ctx, ctx.BlockHeader().Time) require.False(t, inactiveQueue.Valid()) @@ -224,7 +229,11 @@ func TestTickPassedVotingPeriod(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - proposalID := types.GetProposalIDFromBytes(res.Data) + var proposalData types.MsgSubmitProposalResponse + err = proto.Unmarshal(res.Data, &proposalData) + require.NoError(t, err) + + proposalID := proposalData.ProposalId newHeader := ctx.BlockHeader() newHeader.Time = ctx.BlockHeader().Time.Add(time.Duration(1) * time.Second) diff --git a/x/gov/handler.go b/x/gov/handler.go index 5eacdaf10f04..25d97bfabb47 100644 --- a/x/gov/handler.go +++ b/x/gov/handler.go @@ -1,12 +1,6 @@ package gov import ( - "fmt" - "strconv" - - 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/gov/keeper" @@ -14,125 +8,27 @@ import ( ) // NewHandler creates an sdk.Handler for all the gov type messages -func NewHandler(keeper keeper.Keeper) sdk.Handler { +func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgDeposit: - return handleMsgDeposit(ctx, keeper, msg) + res, err := msgServer.Deposit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) - case types.MsgSubmitProposalI: - return handleMsgSubmitProposal(ctx, keeper, msg) + case *types.MsgSubmitProposal: + res, err := msgServer.SubmitProposal(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgVote: - return handleMsgVote(ctx, keeper, msg) + res, err := msgServer.Vote(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -func handleMsgSubmitProposal(ctx sdk.Context, keeper keeper.Keeper, msg types.MsgSubmitProposalI) (*sdk.Result, error) { - proposal, err := keeper.SubmitProposal(ctx, msg.GetContent()) - if err != nil { - return nil, err - } - - defer telemetry.IncrCounter(1, types.ModuleName, "proposal") - - votingStarted, err := keeper.AddDeposit(ctx, proposal.ProposalId, msg.GetProposer(), msg.GetInitialDeposit()) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer().String()), - ), - ) - - submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) - if votingStarted { - submitEvent = submitEvent.AppendAttributes( - sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), - ) - } - - ctx.EventManager().EmitEvent(submitEvent) - - return &sdk.Result{ - Data: types.GetProposalIDBytes(proposal.ProposalId), - Events: ctx.EventManager().ABCIEvents(), - }, nil -} - -func handleMsgDeposit(ctx sdk.Context, keeper keeper.Keeper, msg *types.MsgDeposit) (*sdk.Result, error) { - accAddr, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - return nil, err - } - votingStarted, err := keeper.AddDeposit(ctx, msg.ProposalId, accAddr, msg.Amount) - if err != nil { - return nil, err - } - - defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "deposit"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), - }, - ) - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), - ), - ) - - if votingStarted { - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeProposalDeposit, - sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", msg.ProposalId)), - ), - ) - } - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgVote(ctx sdk.Context, keeper keeper.Keeper, msg *types.MsgVote) (*sdk.Result, error) { - accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) - if accErr != nil { - return nil, accErr - } - err := keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Option) - if err != nil { - return nil, err - } - - defer telemetry.IncrCounterWithLabels( - []string{types.ModuleName, "vote"}, - 1, - []metrics.Label{ - telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), - }, - ) - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Voter), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go new file mode 100644 index 000000000000..aee3d3c3807a --- /dev/null +++ b/x/gov/keeper/msg_server.go @@ -0,0 +1,128 @@ +package keeper + +import ( + "context" + "fmt" + "strconv" + + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/gov/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the gov MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) SubmitProposal(goCtx context.Context, msg *types.MsgSubmitProposal) (*types.MsgSubmitProposalResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + proposal, err := k.Keeper.SubmitProposal(ctx, msg.GetContent()) + if err != nil { + return nil, err + } + + defer telemetry.IncrCounter(1, types.ModuleName, "proposal") + + votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.ProposalId, msg.GetProposer(), msg.GetInitialDeposit()) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.GetProposer().String()), + ), + ) + + submitEvent := sdk.NewEvent(types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalType, msg.GetContent().ProposalType())) + if votingStarted { + submitEvent = submitEvent.AppendAttributes( + sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", proposal.ProposalId)), + ) + } + + ctx.EventManager().EmitEvent(submitEvent) + return &types.MsgSubmitProposalResponse{ + ProposalId: proposal.ProposalId, + }, nil +} + +func (k msgServer) Vote(goCtx context.Context, msg *types.MsgVote) (*types.MsgVoteResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + accAddr, accErr := sdk.AccAddressFromBech32(msg.Voter) + if accErr != nil { + return nil, accErr + } + err := k.Keeper.AddVote(ctx, msg.ProposalId, accAddr, msg.Option) + if err != nil { + return nil, err + } + + defer telemetry.IncrCounterWithLabels( + []string{types.ModuleName, "vote"}, + 1, + []metrics.Label{ + telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), + }, + ) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Voter), + ), + ) + + return &types.MsgVoteResponse{}, nil +} + +func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + accAddr, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + return nil, err + } + votingStarted, err := k.Keeper.AddDeposit(ctx, msg.ProposalId, accAddr, msg.Amount) + if err != nil { + return nil, err + } + + defer telemetry.IncrCounterWithLabels( + []string{types.ModuleName, "deposit"}, + 1, + []metrics.Label{ + telemetry.NewLabel("proposal_id", strconv.Itoa(int(msg.ProposalId))), + }, + ) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), + ), + ) + + if votingStarted { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeProposalDeposit, + sdk.NewAttribute(types.AttributeKeyVotingPeriodStart, fmt.Sprintf("%d", msg.ProposalId)), + ), + ) + } + + return &types.MsgDepositResponse{}, nil +} diff --git a/x/gov/types/msgs.go b/x/gov/types/msgs.go index 42c4ceafd123..e97c25ce8f01 100644 --- a/x/gov/types/msgs.go +++ b/x/gov/types/msgs.go @@ -21,26 +21,9 @@ const ( var ( _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{} - _ MsgSubmitProposalI = &MsgSubmitProposal{} _ types.UnpackInterfacesMessage = &MsgSubmitProposal{} ) -// MsgSubmitProposalI defines the specific interface a concrete message must -// implement in order to process governance proposals. The concrete MsgSubmitProposal -// must be defined at the application-level. -type MsgSubmitProposalI interface { - sdk.Msg - - GetContent() Content - SetContent(Content) error - - GetInitialDeposit() sdk.Coins - SetInitialDeposit(sdk.Coins) - - GetProposer() sdk.AccAddress - SetProposer(sdk.AccAddress) -} - // NewMsgSubmitProposal creates a new MsgSubmitProposal. //nolint:interfacer func NewMsgSubmitProposal(content Content, initialDeposit sdk.Coins, proposer sdk.AccAddress) (*MsgSubmitProposal, error) { @@ -74,7 +57,7 @@ func (m *MsgSubmitProposal) SetInitialDeposit(coins sdk.Coins) { m.InitialDeposit = coins } -func (m *MsgSubmitProposal) SetProposer(address sdk.AccAddress) { +func (m *MsgSubmitProposal) SetProposer(address fmt.Stringer) { m.Proposer = address.String() } diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index a16cc62aa5f4..c1391e12efc6 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -4,13 +4,18 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-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" @@ -67,6 +72,51 @@ func (m *MsgSubmitProposal) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitProposal proto.InternalMessageInfo +// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +type MsgSubmitProposalResponse struct { + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` +} + +func (m *MsgSubmitProposalResponse) Reset() { *m = MsgSubmitProposalResponse{} } +func (m *MsgSubmitProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitProposalResponse) ProtoMessage() {} +func (*MsgSubmitProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{1} +} +func (m *MsgSubmitProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitProposalResponse.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 *MsgSubmitProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitProposalResponse.Merge(m, src) +} +func (m *MsgSubmitProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitProposalResponse proto.InternalMessageInfo + +func (m *MsgSubmitProposalResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + // MsgVote defines a message to cast a vote. type MsgVote struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` @@ -77,7 +127,7 @@ type MsgVote struct { func (m *MsgVote) Reset() { *m = MsgVote{} } func (*MsgVote) ProtoMessage() {} func (*MsgVote) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{1} + return fileDescriptor_3c053992595e3dce, []int{2} } func (m *MsgVote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,6 +156,43 @@ func (m *MsgVote) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVote proto.InternalMessageInfo +// MsgVoteResponse defines the Msg/Vote response type. +type MsgVoteResponse struct { +} + +func (m *MsgVoteResponse) Reset() { *m = MsgVoteResponse{} } +func (m *MsgVoteResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteResponse) ProtoMessage() {} +func (*MsgVoteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{3} +} +func (m *MsgVoteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteResponse.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 *MsgVoteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteResponse.Merge(m, src) +} +func (m *MsgVoteResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteResponse proto.InternalMessageInfo + // MsgDeposit defines a message to submit a deposit to an existing proposal. type MsgDeposit struct { ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id" yaml:"proposal_id"` @@ -116,7 +203,7 @@ type MsgDeposit struct { func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } func (*MsgDeposit) ProtoMessage() {} func (*MsgDeposit) Descriptor() ([]byte, []int) { - return fileDescriptor_3c053992595e3dce, []int{2} + return fileDescriptor_3c053992595e3dce, []int{4} } func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -145,48 +232,251 @@ func (m *MsgDeposit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo +// MsgDepositResponse defines the Msg/Deposit response type. +type MsgDepositResponse struct { +} + +func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } +func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c053992595e3dce, []int{5} +} +func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositResponse.Merge(m, src) +} +func (m *MsgDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1beta1.MsgSubmitProposal") + proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1beta1.MsgSubmitProposalResponse") proto.RegisterType((*MsgVote)(nil), "cosmos.gov.v1beta1.MsgVote") + proto.RegisterType((*MsgVoteResponse)(nil), "cosmos.gov.v1beta1.MsgVoteResponse") proto.RegisterType((*MsgDeposit)(nil), "cosmos.gov.v1beta1.MsgDeposit") + proto.RegisterType((*MsgDepositResponse)(nil), "cosmos.gov.v1beta1.MsgDepositResponse") } func init() { proto.RegisterFile("cosmos/gov/v1beta1/tx.proto", fileDescriptor_3c053992595e3dce) } var fileDescriptor_3c053992595e3dce = []byte{ - // 498 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x31, 0x8b, 0x13, 0x41, - 0x14, 0xde, 0x4d, 0xce, 0xc4, 0x9b, 0xc0, 0x89, 0x43, 0x90, 0x5c, 0x3c, 0x66, 0xc3, 0x82, 0x90, - 0xe6, 0x66, 0xbd, 0x08, 0x16, 0x67, 0x65, 0x4e, 0x04, 0x85, 0xa8, 0xac, 0x60, 0x61, 0x13, 0x76, - 0x37, 0xeb, 0x38, 0x98, 0x9d, 0xb7, 0x64, 0x26, 0xe1, 0xd2, 0x09, 0xf6, 0xe2, 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, 0x6a, 0x55, 0xff, 0xb6, 0xc5, 0xeb, 0xc5, 0x16, - 0xff, 0x69, 0x57, 0x56, 0xda, 0xe4, 0xeb, 0x3f, 0x58, 0x9c, 0x10, 0xe7, 0xf8, 0x84, 0x38, 0x2f, - 0x57, 0xc4, 0x59, 0xac, 0x88, 0x7b, 0xb4, 0x22, 0xee, 0x97, 0x15, 0x71, 0xdf, 0xac, 0x89, 0x73, - 0xb4, 0x26, 0xce, 0xf1, 0x9a, 0x38, 0x4f, 0xff, 0xac, 0x7e, 0xa8, 0xbf, 0x1a, 0x7d, 0x47, 0x5c, - 0xd3, 0xcf, 0xf5, 0xc6, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x32, 0xb4, 0xbb, 0xa1, 0x03, - 0x00, 0x00, + // 586 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x14, 0xb6, 0x93, 0xd2, 0xd0, 0x8b, 0x94, 0xd2, 0x53, 0x84, 0x12, 0xb7, 0xb2, 0x23, 0xa3, 0xa2, + 0x2c, 0xb1, 0x69, 0x90, 0x18, 0xca, 0x44, 0x8a, 0x10, 0x20, 0x45, 0x80, 0x91, 0x18, 0x58, 0x22, + 0xdb, 0x71, 0x8d, 0x45, 0xe2, 0x67, 0xe5, 0x2e, 0x51, 0xb3, 0x31, 0x22, 0x06, 0x60, 0x64, 0xcc, + 0xcc, 0x86, 0xc4, 0x1f, 0x51, 0x31, 0x75, 0x64, 0x40, 0x01, 0x25, 0x0b, 0x30, 0xf6, 0x2f, 0x40, + 0xbe, 0x1f, 0x69, 0xd5, 0xa4, 0x01, 0xa4, 0x4e, 0xc9, 0x7b, 0xdf, 0xfb, 0x3e, 0xdd, 0xf7, 0xdd, + 0xf3, 0xa1, 0x4d, 0x1f, 0x48, 0x17, 0x88, 0x1d, 0xc2, 0xc0, 0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 0x5e, 0x60, 0xbf, 0x88, 0xf0, 0x89, 0x55, 0x99, + 0x40, 0xfd, 0x4d, 0x06, 0x65, 0x9b, 0x24, 0xc4, 0xfb, 0xa8, 0x70, 0xe6, 0x1b, 0xda, 0x5e, 0x14, + 0xf4, 0xdc, 0x66, 0x69, 0xb5, 0x7f, 0x1a, 0x9b, 0x2d, 0xe0, 0x7d, 0xb4, 0xc2, 0x96, 0x66, 0xf3, + 0x1c, 0x5a, 0x0a, 0x6a, 0xd7, 0x96, 0x80, 0x33, 0xa5, 0x27, 0x28, 0x27, 0xef, 0x4d, 0x3f, 0x67, + 0x5e, 0xe0, 0xda, 0xf5, 0xe5, 0xb8, 0x94, 0x6c, 0x34, 0x0e, 0x27, 0xba, 0x7a, 0x34, 0xd1, 0xd5, + 0x1f, 0x13, 0x5d, 0x7d, 0x3f, 0xd5, 0x95, 0xa3, 0xa9, 0xae, 0x7c, 0x9d, 0xea, 0xca, 0xf3, 0xe5, + 0x17, 0x70, 0xc0, 0x1e, 0x3a, 0x76, 0x0d, 0xde, 0x2a, 0x7b, 0x61, 0x6e, 0xfe, 0x09, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0x09, 0x3f, 0x57, 0x54, 0x05, 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 { + // SubmitProposal defines a method to create new proposal given a content. + SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SubmitProposal(ctx context.Context, in *MsgSubmitProposal, opts ...grpc.CallOption) (*MsgSubmitProposalResponse, error) { + out := new(MsgSubmitProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/SubmitProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Vote(ctx context.Context, in *MsgVote, opts ...grpc.CallOption) (*MsgVoteResponse, error) { + out := new(MsgVoteResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Vote", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + out := new(MsgDepositResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1beta1.Msg/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SubmitProposal defines a method to create new proposal given a content. + SubmitProposal(context.Context, *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) + // Vote defines a method to add a vote on a specific proposal. + Vote(context.Context, *MsgVote) (*MsgVoteResponse, error) + // Deposit defines a method to add deposit on a specific proposal. + Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitProposal(ctx context.Context, req *MsgSubmitProposal) (*MsgSubmitProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitProposal not implemented") +} +func (*UnimplementedMsgServer) Vote(ctx context.Context, req *MsgVote) (*MsgVoteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Vote not implemented") +} +func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SubmitProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/SubmitProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitProposal(ctx, req.(*MsgSubmitProposal)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Vote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVote) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Vote(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/Vote", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Vote(ctx, req.(*MsgVote)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeposit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1beta1.Msg/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.gov.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitProposal", + Handler: _Msg_SubmitProposal_Handler, + }, + { + MethodName: "Vote", + Handler: _Msg_Vote_Handler, + }, + { + MethodName: "Deposit", + Handler: _Msg_Deposit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/gov/v1beta1/tx.proto", } func (m *MsgSubmitProposal) Marshal() (dAtA []byte, err error) { @@ -245,6 +535,34 @@ func (m *MsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSubmitProposalResponse) 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 *MsgSubmitProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *MsgVote) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -285,6 +603,29 @@ func (m *MsgVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgVoteResponse) 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 *MsgVoteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgDeposit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -334,6 +675,29 @@ func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDepositResponse) 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 @@ -368,6 +732,18 @@ func (m *MsgSubmitProposal) Size() (n int) { return n } +func (m *MsgSubmitProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + return n +} + func (m *MsgVote) Size() (n int) { if m == nil { return 0 @@ -387,6 +763,15 @@ func (m *MsgVote) Size() (n int) { return n } +func (m *MsgVoteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgDeposit) Size() (n int) { if m == nil { return 0 @@ -409,6 +794,15 @@ func (m *MsgDeposit) Size() (n int) { return n } +func (m *MsgDepositResponse) 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 } @@ -570,6 +964,78 @@ func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitProposalResponse) 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: MsgSubmitProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *MsgVote) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -693,6 +1159,59 @@ func (m *MsgVote) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgVoteResponse) 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: MsgVoteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteResponse: 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 *MsgDeposit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -831,6 +1350,59 @@ func (m *MsgDeposit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgDepositResponse) 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: MsgDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositResponse: 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 c6fefbbd51ab2452e2240834a1ec989a4fc5332b Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Thu, 15 Oct 2020 19:24:16 +0530 Subject: [PATCH 05/12] Refactor x/distribution according to ADR 031 (#7524) * Refactor x/distribution according to ADR 31 * lint * removed unused * Apply suggestions from code review Co-authored-by: Marie Gauthier Co-authored-by: Aaron Craelius Co-authored-by: Marie Gauthier Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/distribution/v1beta1/tx.proto | 33 +- x/distribution/handler.go | 130 +--- x/distribution/keeper/msg_server.go | 140 ++++ x/distribution/types/tx.pb.go | 859 ++++++++++++++++++++- 4 files changed, 1009 insertions(+), 153 deletions(-) create mode 100644 x/distribution/keeper/msg_server.go diff --git a/proto/cosmos/distribution/v1beta1/tx.proto b/proto/cosmos/distribution/v1beta1/tx.proto index 97427c49bd1d..783f06d1d79d 100644 --- a/proto/cosmos/distribution/v1beta1/tx.proto +++ b/proto/cosmos/distribution/v1beta1/tx.proto @@ -7,6 +7,25 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +// Msg defines the distribution Msg service. +service Msg { + // SetWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); + + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); + + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address. + rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); + + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); +} + // MsgSetWithdrawAddress sets the withdraw address for // a delegator (or validator self-delegation). message MsgSetWithdrawAddress { @@ -17,6 +36,9 @@ message MsgSetWithdrawAddress { string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; } +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +message MsgSetWithdrawAddressResponse { } + // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. message MsgWithdrawDelegatorReward { @@ -27,6 +49,9 @@ message MsgWithdrawDelegatorReward { string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; } +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +message MsgWithdrawDelegatorRewardResponse { } + // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. message MsgWithdrawValidatorCommission { @@ -36,6 +61,9 @@ message MsgWithdrawValidatorCommission { string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; } +// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +message MsgWithdrawValidatorCommissionResponse { } + // MsgFundCommunityPool allows an account to directly // fund the community pool. message MsgFundCommunityPool { @@ -45,4 +73,7 @@ message MsgFundCommunityPool { repeated cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; string depositor = 2; -} \ No newline at end of file +} + +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +message MsgFundCommunityPoolResponse { } diff --git a/x/distribution/handler.go b/x/distribution/handler.go index 36274544b2d9..e89b9fbf8c06 100644 --- a/x/distribution/handler.go +++ b/x/distribution/handler.go @@ -1,9 +1,6 @@ package distribution 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/distribution/keeper" @@ -15,18 +12,24 @@ 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.MsgSetWithdrawAddress: - return handleMsgModifyWithdrawAddress(ctx, msg, k) + res, err := msgServer.SetWithdrawAddress(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgWithdrawDelegatorReward: - return handleMsgWithdrawDelegatorReward(ctx, msg, k) + res, err := msgServer.WithdrawDelegatorReward(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgWithdrawValidatorCommission: - return handleMsgWithdrawValidatorCommission(ctx, msg, k) + res, err := msgServer.WithdrawValidatorCommission(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgFundCommunityPool: - return handleMsgFundCommunityPool(ctx, msg, k) + res, err := msgServer.FundCommunityPool(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized distribution message type: %T", msg) @@ -34,119 +37,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler { } } -// These functions assume everything has been authenticated (ValidateBasic passed, and signatures checked) - -func handleMsgModifyWithdrawAddress(ctx sdk.Context, msg *types.MsgSetWithdrawAddress, k keeper.Keeper) (*sdk.Result, error) { - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - withdrawAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - err = k.SetWithdrawAddr(ctx, delegatorAddress, withdrawAddress) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgWithdrawDelegatorReward(ctx sdk.Context, msg *types.MsgWithdrawDelegatorReward, k keeper.Keeper) (*sdk.Result, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - amount, err := k.WithdrawDelegationRewards(ctx, delegatorAddress, valAddr) - if err != nil { - return nil, err - } - - defer func() { - for _, a := range amount { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "withdraw_reward"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - }() - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgWithdrawValidatorCommission(ctx sdk.Context, msg *types.MsgWithdrawValidatorCommission, k keeper.Keeper) (*sdk.Result, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - amount, err := k.WithdrawValidatorCommission(ctx, valAddr) - if err != nil { - return nil, err - } - - defer func() { - for _, a := range amount { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "withdraw_commission"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - }() - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgFundCommunityPool(ctx sdk.Context, msg *types.MsgFundCommunityPool, k keeper.Keeper) (*sdk.Result, error) { - depositer, err := sdk.AccAddressFromBech32(msg.Depositor) - if err != nil { - return nil, err - } - if err := k.FundCommunityPool(ctx, msg.Amount, depositer); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - func NewCommunityPoolSpendProposalHandler(k keeper.Keeper) govtypes.Handler { return func(ctx sdk.Context, content govtypes.Content) error { switch c := content.(type) { diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go new file mode 100644 index 000000000000..9aa24529d8e7 --- /dev/null +++ b/x/distribution/keeper/msg_server.go @@ -0,0 +1,140 @@ +package keeper + +import ( + "context" + + "github.com/armon/go-metrics" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/distribution/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) SetWithdrawAddress(goCtx context.Context, msg *types.MsgSetWithdrawAddress) (*types.MsgSetWithdrawAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + withdrawAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + err = k.SetWithdrawAddr(ctx, delegatorAddress, withdrawAddress) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + ) + + return &types.MsgSetWithdrawAddressResponse{}, nil +} + +func (k msgServer) WithdrawDelegatorReward(goCtx context.Context, msg *types.MsgWithdrawDelegatorReward) (*types.MsgWithdrawDelegatorRewardResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + amount, err := k.WithdrawDelegationRewards(ctx, delegatorAddress, valAddr) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_reward"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + ) + return &types.MsgWithdrawDelegatorRewardResponse{}, nil +} + +func (k msgServer) WithdrawValidatorCommission(goCtx context.Context, msg *types.MsgWithdrawValidatorCommission) (*types.MsgWithdrawValidatorCommissionResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + amount, err := k.Keeper.WithdrawValidatorCommission(ctx, valAddr) + if err != nil { + return nil, err + } + + defer func() { + for _, a := range amount { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "withdraw_commission"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + }() + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), + ), + ) + + return &types.MsgWithdrawValidatorCommissionResponse{}, nil +} + +func (k msgServer) FundCommunityPool(goCtx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + depositer, err := sdk.AccAddressFromBech32(msg.Depositor) + if err != nil { + return nil, err + } + if err := k.Keeper.FundCommunityPool(ctx, msg.Amount, depositer); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Depositor), + ), + ) + + return &types.MsgFundCommunityPoolResponse{}, nil +} diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 38261f340aa0..5d7d761de951 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/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" + grpc1 "github.com/gogo/protobuf/grpc" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" 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,43 @@ func (m *MsgSetWithdrawAddress) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetWithdrawAddress proto.InternalMessageInfo +// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +type MsgSetWithdrawAddressResponse struct { +} + +func (m *MsgSetWithdrawAddressResponse) Reset() { *m = MsgSetWithdrawAddressResponse{} } +func (m *MsgSetWithdrawAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetWithdrawAddressResponse) ProtoMessage() {} +func (*MsgSetWithdrawAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{1} +} +func (m *MsgSetWithdrawAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetWithdrawAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetWithdrawAddressResponse.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 *MsgSetWithdrawAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetWithdrawAddressResponse.Merge(m, src) +} +func (m *MsgSetWithdrawAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetWithdrawAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetWithdrawAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetWithdrawAddressResponse proto.InternalMessageInfo + // MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator // from a single validator. type MsgWithdrawDelegatorReward struct { @@ -76,7 +118,7 @@ func (m *MsgWithdrawDelegatorReward) Reset() { *m = MsgWithdrawDelegator func (m *MsgWithdrawDelegatorReward) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawDelegatorReward) ProtoMessage() {} func (*MsgWithdrawDelegatorReward) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{1} + return fileDescriptor_ed4f433d965e58ca, []int{2} } func (m *MsgWithdrawDelegatorReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -105,6 +147,43 @@ func (m *MsgWithdrawDelegatorReward) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawDelegatorReward proto.InternalMessageInfo +// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +type MsgWithdrawDelegatorRewardResponse struct { +} + +func (m *MsgWithdrawDelegatorRewardResponse) Reset() { *m = MsgWithdrawDelegatorRewardResponse{} } +func (m *MsgWithdrawDelegatorRewardResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawDelegatorRewardResponse) ProtoMessage() {} +func (*MsgWithdrawDelegatorRewardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{3} +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.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 *MsgWithdrawDelegatorRewardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.Merge(m, src) +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawDelegatorRewardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawDelegatorRewardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawDelegatorRewardResponse proto.InternalMessageInfo + // MsgWithdrawValidatorCommission withdraws the full commission to the validator // address. type MsgWithdrawValidatorCommission struct { @@ -115,7 +194,7 @@ func (m *MsgWithdrawValidatorCommission) Reset() { *m = MsgWithdrawValid func (m *MsgWithdrawValidatorCommission) String() string { return proto.CompactTextString(m) } func (*MsgWithdrawValidatorCommission) ProtoMessage() {} func (*MsgWithdrawValidatorCommission) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{2} + return fileDescriptor_ed4f433d965e58ca, []int{4} } func (m *MsgWithdrawValidatorCommission) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -144,6 +223,45 @@ func (m *MsgWithdrawValidatorCommission) XXX_DiscardUnknown() { var xxx_messageInfo_MsgWithdrawValidatorCommission proto.InternalMessageInfo +// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +type MsgWithdrawValidatorCommissionResponse struct { +} + +func (m *MsgWithdrawValidatorCommissionResponse) Reset() { + *m = MsgWithdrawValidatorCommissionResponse{} +} +func (m *MsgWithdrawValidatorCommissionResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawValidatorCommissionResponse) ProtoMessage() {} +func (*MsgWithdrawValidatorCommissionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{5} +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.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 *MsgWithdrawValidatorCommissionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.Merge(m, src) +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawValidatorCommissionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawValidatorCommissionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawValidatorCommissionResponse proto.InternalMessageInfo + // MsgFundCommunityPool allows an account to directly // fund the community pool. type MsgFundCommunityPool struct { @@ -155,7 +273,7 @@ func (m *MsgFundCommunityPool) Reset() { *m = MsgFundCommunityPool{} } func (m *MsgFundCommunityPool) String() string { return proto.CompactTextString(m) } func (*MsgFundCommunityPool) ProtoMessage() {} func (*MsgFundCommunityPool) Descriptor() ([]byte, []int) { - return fileDescriptor_ed4f433d965e58ca, []int{3} + return fileDescriptor_ed4f433d965e58ca, []int{6} } func (m *MsgFundCommunityPool) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -184,11 +302,52 @@ func (m *MsgFundCommunityPool) XXX_DiscardUnknown() { var xxx_messageInfo_MsgFundCommunityPool proto.InternalMessageInfo +// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +type MsgFundCommunityPoolResponse struct { +} + +func (m *MsgFundCommunityPoolResponse) Reset() { *m = MsgFundCommunityPoolResponse{} } +func (m *MsgFundCommunityPoolResponse) String() string { return proto.CompactTextString(m) } +func (*MsgFundCommunityPoolResponse) ProtoMessage() {} +func (*MsgFundCommunityPoolResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ed4f433d965e58ca, []int{7} +} +func (m *MsgFundCommunityPoolResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgFundCommunityPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgFundCommunityPoolResponse.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 *MsgFundCommunityPoolResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgFundCommunityPoolResponse.Merge(m, src) +} +func (m *MsgFundCommunityPoolResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgFundCommunityPoolResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgFundCommunityPoolResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgFundCommunityPoolResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgSetWithdrawAddress)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddress") + proto.RegisterType((*MsgSetWithdrawAddressResponse)(nil), "cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") proto.RegisterType((*MsgWithdrawDelegatorReward)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") + proto.RegisterType((*MsgWithdrawDelegatorRewardResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") proto.RegisterType((*MsgWithdrawValidatorCommission)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") + proto.RegisterType((*MsgWithdrawValidatorCommissionResponse)(nil), "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") proto.RegisterType((*MsgFundCommunityPool)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPool") + proto.RegisterType((*MsgFundCommunityPoolResponse)(nil), "cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") } func init() { @@ -196,35 +355,331 @@ func init() { } var fileDescriptor_ed4f433d965e58ca = []byte{ - // 436 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xbd, 0x8e, 0xd3, 0x40, - 0x1c, 0xc4, 0xbd, 0x87, 0x74, 0xe2, 0x96, 0x82, 0x9c, 0x75, 0x88, 0x90, 0x3b, 0xad, 0x4f, 0x16, - 0x45, 0x1a, 0x6c, 0x02, 0xdd, 0x75, 0xe4, 0xd0, 0x49, 0x29, 0x22, 0x90, 0x91, 0x40, 0xa2, 0x41, - 0x6b, 0xef, 0xca, 0x59, 0x61, 0xfb, 0x1f, 0x79, 0xd7, 0x71, 0xf2, 0x06, 0x94, 0x3c, 0x42, 0x24, - 0x1a, 0x44, 0x4d, 0xc9, 0x03, 0xa4, 0x4c, 0x49, 0x15, 0x90, 0xd3, 0x50, 0xe7, 0x09, 0x50, 0xfc, - 0x95, 0x2f, 0x44, 0x03, 0x95, 0xad, 0xf1, 0xec, 0x6f, 0x46, 0xd6, 0x2c, 0x7e, 0xe8, 0x81, 0x0c, - 0x41, 0xda, 0x4c, 0x48, 0x15, 0x0b, 0x37, 0x51, 0x02, 0x22, 0x7b, 0xd4, 0x71, 0xb9, 0xa2, 0x1d, - 0x5b, 0x8d, 0xad, 0x61, 0x0c, 0x0a, 0xf4, 0xf3, 0xc2, 0x65, 0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 0x84, - 0x9a, 0xbc, 0x04, 0x08, 0x74, 0x0f, 0x1f, 0xd3, 0x10, 0x92, 0x48, 0x35, 0xd1, 0xe5, 0xad, 0xf6, - 0x9d, 0x27, 0x0f, 0xac, 0x72, 0x69, 0xeb, 0xd9, 0x54, 0x0b, 0xb3, 0xae, 0x41, 0x44, 0xdd, 0xc7, - 0xb3, 0x85, 0xa1, 0x7d, 0xf9, 0x61, 0xb4, 0x7d, 0xa1, 0x06, 0x89, 0x6b, 0x79, 0x10, 0xda, 0xe5, - 0xc6, 0x8a, 0xc7, 0x23, 0xc9, 0xde, 0xdb, 0x6a, 0x32, 0xe4, 0x32, 0x3f, 0x20, 0x9d, 0x12, 0xad, - 0x5f, 0xe0, 0x13, 0xc6, 0x87, 0x20, 0x85, 0x82, 0xb8, 0xf8, 0x83, 0xce, 0x46, 0xd8, 0xb4, 0xec, - 0xbe, 0xf8, 0x9c, 0x11, 0x34, 0xcb, 0x08, 0x9a, 0x67, 0x04, 0xfd, 0xcc, 0x08, 0xfa, 0xb8, 0x24, - 0xda, 0x7c, 0x49, 0xb4, 0xef, 0x4b, 0xa2, 0xbd, 0xed, 0xfc, 0x35, 0x77, 0xbc, 0x7b, 0x83, 0xf2, - 0x1a, 0xee, 0x71, 0x3e, 0xf5, 0xa7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x89, 0x6e, 0x9f, 0xc2, - 0x65, 0x03, 0x00, 0x00, + // 558 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x3f, 0x6f, 0xd3, 0x40, + 0x18, 0xc6, 0x7d, 0x2d, 0xaa, 0xe8, 0x31, 0x90, 0x58, 0x45, 0x0d, 0x4e, 0x38, 0x57, 0x56, 0x85, + 0xb2, 0x60, 0x93, 0x30, 0x20, 0xc2, 0x80, 0x48, 0x50, 0xa5, 0x0e, 0x11, 0xc8, 0x48, 0x20, 0xb1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x3f, 0xfa, 0x45, 0xcc, 0xbf, + 0x83, 0x99, 0x7d, 0x10, 0xac, 0xe4, 0x85, 0x4c, 0xb6, 0xa8, 0x0f, 0xaf, 0xc0, 0xf5, 0x36, 0x77, + 0xe4, 0x77, 0x00, 0xca, 0x39, 0x17, 0xa5, 0xae, 0x2f, 0xb9, 0x96, 0x7a, 0x6e, 0x4d, 0x95, 0xc6, + 0xc5, 0x3d, 0x49, 0x1c, 0xf9, 0x23, 0x80, 0xdb, 0x8b, 0x7a, 0x7d, 0xff, 0x3c, 0xee, 0x02, 0xa3, + 0xf2, 0xe8, 0x3f, 0x8d, 0x69, 0xaa, 0x4f, 0x00, 0x96, 0x97, 0x35, 0xf1, 0xe1, 0xbf, 0x3e, 0x20, + 0xc7, 0xac, 0xb4, 0x56, 0x30, 0xa7, 0x09, 0xdf, 0x02, 0x58, 0xcc, 0x36, 0xb1, 0x76, 0x1e, 0x3a, + 0x63, 0x51, 0x1e, 0x5c, 0xd8, 0x92, 0x64, 0x68, 0x3e, 0xfd, 0x32, 0x46, 0x60, 0x38, 0x46, 0xe0, + 0x64, 0x8c, 0xc0, 0xaf, 0x31, 0x02, 0x1f, 0x26, 0x48, 0x3a, 0x99, 0x20, 0xe9, 0xc7, 0x04, 0x49, + 0xaf, 0x6a, 0x4b, 0x2b, 0x7e, 0x34, 0xff, 0x76, 0x08, 0x1b, 0x6f, 0x6f, 0x84, 0x7f, 0xe3, 0xf7, + 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x18, 0x71, 0xb0, 0x41, 0x06, 0x00, 0x00, +} + +func (this *MsgSetWithdrawAddressResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSetWithdrawAddressResponse) + if !ok { + that2, ok := that.(MsgSetWithdrawAddressResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgWithdrawDelegatorRewardResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawDelegatorRewardResponse) + if !ok { + that2, ok := that.(MsgWithdrawDelegatorRewardResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgWithdrawValidatorCommissionResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgWithdrawValidatorCommissionResponse) + if !ok { + that2, ok := that.(MsgWithdrawValidatorCommissionResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} +func (this *MsgFundCommunityPoolResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgFundCommunityPoolResponse) + if !ok { + that2, ok := that.(MsgFundCommunityPoolResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} + +// 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 { + // ModifyWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address + WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) { + out := new(MsgSetWithdrawAddressResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) { + out := new(MsgWithdrawDelegatorRewardResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) { + out := new(MsgWithdrawValidatorCommissionResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityPool, opts ...grpc.CallOption) (*MsgFundCommunityPoolResponse, error) { + out := new(MsgFundCommunityPoolResponse) + err := c.cc.Invoke(ctx, "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ModifyWithdrawAddress defines a method to change the withdraw address + // for a delegator (or validator self-delegation). + SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) + // WithdrawDelegatorReward defines a method to withdraw rewards of delegator + // from a single validator. + WithdrawDelegatorReward(context.Context, *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) + // WithdrawValidatorCommission defines a method to withdraw the + // full commission to the validator address + WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) + // FundCommunityPool defines a method to allow an account to directly + // fund the community pool. + FundCommunityPool(context.Context, *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetWithdrawAddress(ctx context.Context, req *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetWithdrawAddress not implemented") +} +func (*UnimplementedMsgServer) WithdrawDelegatorReward(ctx context.Context, req *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawDelegatorReward not implemented") +} +func (*UnimplementedMsgServer) WithdrawValidatorCommission(ctx context.Context, req *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method WithdrawValidatorCommission not implemented") +} +func (*UnimplementedMsgServer) FundCommunityPool(ctx context.Context, req *MsgFundCommunityPool) (*MsgFundCommunityPoolResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FundCommunityPool not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetWithdrawAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetWithdrawAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetWithdrawAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetWithdrawAddress(ctx, req.(*MsgSetWithdrawAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawDelegatorReward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawDelegatorReward) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawDelegatorReward(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawDelegatorReward", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawDelegatorReward(ctx, req.(*MsgWithdrawDelegatorReward)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_WithdrawValidatorCommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdrawValidatorCommission) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).WithdrawValidatorCommission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/WithdrawValidatorCommission", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).WithdrawValidatorCommission(ctx, req.(*MsgWithdrawValidatorCommission)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_FundCommunityPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgFundCommunityPool) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).FundCommunityPool(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.distribution.v1beta1.Msg/FundCommunityPool", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).FundCommunityPool(ctx, req.(*MsgFundCommunityPool)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.distribution.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetWithdrawAddress", + Handler: _Msg_SetWithdrawAddress_Handler, + }, + { + MethodName: "WithdrawDelegatorReward", + Handler: _Msg_WithdrawDelegatorReward_Handler, + }, + { + MethodName: "WithdrawValidatorCommission", + Handler: _Msg_WithdrawValidatorCommission_Handler, + }, + { + MethodName: "FundCommunityPool", + Handler: _Msg_FundCommunityPool_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/distribution/v1beta1/tx.proto", } func (m *MsgSetWithdrawAddress) Marshal() (dAtA []byte, err error) { @@ -264,6 +719,29 @@ func (m *MsgSetWithdrawAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSetWithdrawAddressResponse) 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 *MsgSetWithdrawAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetWithdrawAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgWithdrawDelegatorReward) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -301,6 +779,29 @@ func (m *MsgWithdrawDelegatorReward) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgWithdrawDelegatorRewardResponse) 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 *MsgWithdrawDelegatorRewardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawDelegatorRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgWithdrawValidatorCommission) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -331,6 +832,29 @@ func (m *MsgWithdrawValidatorCommission) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgWithdrawValidatorCommissionResponse) 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 *MsgWithdrawValidatorCommissionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawValidatorCommissionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgFundCommunityPool) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -375,6 +899,29 @@ func (m *MsgFundCommunityPool) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgFundCommunityPoolResponse) 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 *MsgFundCommunityPoolResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgFundCommunityPoolResponse) 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 @@ -403,6 +950,15 @@ func (m *MsgSetWithdrawAddress) Size() (n int) { return n } +func (m *MsgSetWithdrawAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgWithdrawDelegatorReward) Size() (n int) { if m == nil { return 0 @@ -420,6 +976,15 @@ func (m *MsgWithdrawDelegatorReward) Size() (n int) { return n } +func (m *MsgWithdrawDelegatorRewardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgWithdrawValidatorCommission) Size() (n int) { if m == nil { return 0 @@ -433,6 +998,15 @@ func (m *MsgWithdrawValidatorCommission) Size() (n int) { return n } +func (m *MsgWithdrawValidatorCommissionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgFundCommunityPool) Size() (n int) { if m == nil { return 0 @@ -452,6 +1026,15 @@ func (m *MsgFundCommunityPool) Size() (n int) { return n } +func (m *MsgFundCommunityPoolResponse) 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 } @@ -575,6 +1158,59 @@ func (m *MsgSetWithdrawAddress) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSetWithdrawAddressResponse) 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: MsgSetWithdrawAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetWithdrawAddressResponse: 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 *MsgWithdrawDelegatorReward) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -692,6 +1328,59 @@ func (m *MsgWithdrawDelegatorReward) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgWithdrawDelegatorRewardResponse) 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: MsgWithdrawDelegatorRewardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawDelegatorRewardResponse: 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 *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -777,6 +1466,59 @@ func (m *MsgWithdrawValidatorCommission) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgWithdrawValidatorCommissionResponse) 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: MsgWithdrawValidatorCommissionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawValidatorCommissionResponse: 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 *MsgFundCommunityPool) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -896,6 +1638,59 @@ func (m *MsgFundCommunityPool) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgFundCommunityPoolResponse) 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: MsgFundCommunityPoolResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgFundCommunityPoolResponse: 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 65ba5a0f3f7a08d31d8fb44a7017ee3c3235be24 Mon Sep 17 00:00:00 2001 From: Marie Gauthier Date: Thu, 15 Oct 2020 16:38:15 +0200 Subject: [PATCH 06/12] [x/slashing] Implement Protobuf Msg Services (#7557) * Update x/slashing to use proto msg service * Fix proto-gen Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/slashing/v1beta1/tx.proto | 17 +- x/bank/types/tx.pb.go | 6 + x/distribution/types/tx.pb.go | 10 +- x/gov/types/tx.pb.go | 2 +- x/slashing/handler.go | 28 +-- x/slashing/keeper/msg_server.go | 46 +++++ x/slashing/types/tx.pb.go | 256 ++++++++++++++++++++++++- 7 files changed, 321 insertions(+), 44 deletions(-) create mode 100644 x/slashing/keeper/msg_server.go diff --git a/proto/cosmos/slashing/v1beta1/tx.proto b/proto/cosmos/slashing/v1beta1/tx.proto index 14494aa47776..4d63370ecca8 100644 --- a/proto/cosmos/slashing/v1beta1/tx.proto +++ b/proto/cosmos/slashing/v1beta1/tx.proto @@ -6,12 +6,21 @@ option (gogoproto.equal_all) = true; import "gogoproto/gogo.proto"; -// MsgUnjail is an sdk.Msg used for unjailing a jailed validator, thus returning -// them into the bonded validator set, so they can begin receiving provisions -// and rewards again. +// Msg defines the slashing Msg service. +service Msg { + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); +} + +// MsgUnjail defines the Msg/Unjail request type message MsgUnjail { option (gogoproto.goproto_getters) = false; option (gogoproto.goproto_stringer) = true; string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; -} \ No newline at end of file +} + +// MsgUnjailResponse defines the Msg/Unjail response type +message MsgUnjailResponse {} \ No newline at end of file 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) } diff --git a/x/distribution/types/tx.pb.go b/x/distribution/types/tx.pb.go index 5d7d761de951..7748badacf4f 100644 --- a/x/distribution/types/tx.pb.go +++ b/x/distribution/types/tx.pb.go @@ -7,9 +7,9 @@ import ( context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - grpc1 "github.com/gogo/protobuf/grpc" 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" @@ -490,14 +490,14 @@ 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 { - // ModifyWithdrawAddress defines a method to change the withdraw address + // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). SetWithdrawAddress(ctx context.Context, in *MsgSetWithdrawAddress, opts ...grpc.CallOption) (*MsgSetWithdrawAddressResponse, error) // WithdrawDelegatorReward defines a method to withdraw rewards of delegator // from a single validator. WithdrawDelegatorReward(ctx context.Context, in *MsgWithdrawDelegatorReward, opts ...grpc.CallOption) (*MsgWithdrawDelegatorRewardResponse, error) // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address + // full commission to the validator address. WithdrawValidatorCommission(ctx context.Context, in *MsgWithdrawValidatorCommission, opts ...grpc.CallOption) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. @@ -550,14 +550,14 @@ func (c *msgClient) FundCommunityPool(ctx context.Context, in *MsgFundCommunityP // MsgServer is the server API for Msg service. type MsgServer interface { - // ModifyWithdrawAddress defines a method to change the withdraw address + // SetWithdrawAddress defines a method to change the withdraw address // for a delegator (or validator self-delegation). SetWithdrawAddress(context.Context, *MsgSetWithdrawAddress) (*MsgSetWithdrawAddressResponse, error) // WithdrawDelegatorReward defines a method to withdraw rewards of delegator // from a single validator. WithdrawDelegatorReward(context.Context, *MsgWithdrawDelegatorReward) (*MsgWithdrawDelegatorRewardResponse, error) // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address + // full commission to the validator address. WithdrawValidatorCommission(context.Context, *MsgWithdrawValidatorCommission) (*MsgWithdrawValidatorCommissionResponse, error) // FundCommunityPool defines a method to allow an account to directly // fund the community pool. diff --git a/x/gov/types/tx.pb.go b/x/gov/types/tx.pb.go index c1391e12efc6..c4d9a9670153 100644 --- a/x/gov/types/tx.pb.go +++ b/x/gov/types/tx.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" - grpc1 "github.com/gogo/protobuf/grpc" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-proto" grpc "google.golang.org/grpc" diff --git a/x/slashing/handler.go b/x/slashing/handler.go index e27b1e439a7e..eab71edb4188 100644 --- a/x/slashing/handler.go +++ b/x/slashing/handler.go @@ -12,35 +12,15 @@ 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.MsgUnjail: - return handleMsgUnjail(ctx, msg, k) + res, err := msgServer.Unjail(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -// Validators must submit a transaction to unjail itself after -// having been jailed (and thus unbonded) for downtime -func handleMsgUnjail(ctx sdk.Context, msg *types.MsgUnjail, k keeper.Keeper) (*sdk.Result, error) { - valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddr) - if valErr != nil { - return nil, valErr - } - err := k.Unjail(ctx, valAddr) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddr), - ), - ) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/slashing/keeper/msg_server.go b/x/slashing/keeper/msg_server.go new file mode 100644 index 000000000000..90a2558384a3 --- /dev/null +++ b/x/slashing/keeper/msg_server.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/slashing/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the slashing MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +// Unjail implements MsgServer.Unjail method. +// Validators must submit a transaction to unjail itself after +// having been jailed (and thus unbonded) for downtime +func (k msgServer) Unjail(goCtx context.Context, msg *types.MsgUnjail) (*types.MsgUnjailResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddr) + if valErr != nil { + return nil, valErr + } + err := k.Keeper.Unjail(ctx, valAddr) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddr), + ), + ) + + return &types.MsgUnjailResponse{}, nil +} diff --git a/x/slashing/types/tx.pb.go b/x/slashing/types/tx.pb.go index 01e951a7c8ab..8412b3291beb 100644 --- a/x/slashing/types/tx.pb.go +++ b/x/slashing/types/tx.pb.go @@ -4,9 +4,14 @@ package types 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" @@ -23,9 +28,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgUnjail is an sdk.Msg used for unjailing a jailed validator, thus returning -// them into the bonded validator set, so they can begin receiving provisions -// and rewards again. +// MsgUnjail defines the Msg/Unjail request type type MsgUnjail struct { ValidatorAddr string `protobuf:"bytes,1,opt,name=validator_addr,json=validatorAddr,proto3" json:"address" yaml:"address"` } @@ -63,14 +66,52 @@ func (m *MsgUnjail) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUnjail proto.InternalMessageInfo +// MsgUnjailResponse defines the Msg/Unjail response type +type MsgUnjailResponse struct { +} + +func (m *MsgUnjailResponse) Reset() { *m = MsgUnjailResponse{} } +func (m *MsgUnjailResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUnjailResponse) ProtoMessage() {} +func (*MsgUnjailResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3c5611c0c4a59d9d, []int{1} +} +func (m *MsgUnjailResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnjailResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnjailResponse.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 *MsgUnjailResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnjailResponse.Merge(m, src) +} +func (m *MsgUnjailResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnjailResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnjailResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnjailResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUnjail)(nil), "cosmos.slashing.v1beta1.MsgUnjail") + proto.RegisterType((*MsgUnjailResponse)(nil), "cosmos.slashing.v1beta1.MsgUnjailResponse") } func init() { proto.RegisterFile("cosmos/slashing/v1beta1/tx.proto", fileDescriptor_3c5611c0c4a59d9d) } var fileDescriptor_3c5611c0c4a59d9d = []byte{ - // 227 bytes of a gzipped FileDescriptorProto + // 269 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x2f, 0xce, 0x49, 0x2c, 0xce, 0xc8, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, @@ -80,12 +121,14 @@ var fileDescriptor_3c5611c0c4a59d9d = []byte{ 0x52, 0x8a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x64, 0x5f, 0xdd, 0x93, 0x67, 0x07, 0xf1, 0x53, 0x8b, 0x8b, 0x3f, 0xdd, 0x93, 0xe7, 0xab, 0x4c, 0xcc, 0xcd, 0xb1, 0x52, 0x82, 0x0a, 0x28, 0x05, 0xf1, 0xc2, 0x35, 0x39, 0xa6, 0xa4, 0x14, 0x59, 0x71, 0x74, 0x2c, 0x90, 0x67, 0x98, 0xb1, - 0x40, 0x9e, 0xd1, 0xc9, 0x7b, 0xc5, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, - 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, - 0x96, 0x63, 0x88, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, - 0x7a, 0x0b, 0x42, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, 0x20, 0xfc, 0x58, 0x52, 0x59, 0x90, 0x5a, - 0x9c, 0xc4, 0x06, 0x76, 0xb0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x4a, 0x48, 0x01, 0x03, - 0x01, 0x00, 0x00, + 0x40, 0x9e, 0x51, 0x49, 0x98, 0x4b, 0x10, 0x6e, 0x78, 0x50, 0x6a, 0x71, 0x41, 0x7e, 0x5e, 0x71, + 0xaa, 0x51, 0x3c, 0x17, 0xb3, 0x6f, 0x71, 0xba, 0x50, 0x04, 0x17, 0x1b, 0xd4, 0x56, 0x25, 0x3d, + 0x1c, 0x4e, 0xd6, 0x83, 0x6b, 0x96, 0xd2, 0x22, 0xac, 0x06, 0x66, 0x81, 0x93, 0xf7, 0x8a, 0x47, + 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, + 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x0d, 0x4c, 0x08, 0xa5, 0x5b, 0x9c, 0x92, + 0xad, 0x5f, 0x81, 0x08, 0xd9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x30, 0x19, 0x03, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x1b, 0xa7, 0xdc, 0xcf, 0x79, 0x01, 0x00, 0x00, } func (this *MsgUnjail) Equal(that interface{}) bool { @@ -112,6 +155,114 @@ func (this *MsgUnjail) Equal(that interface{}) bool { } return true } +func (this *MsgUnjailResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgUnjailResponse) + if !ok { + that2, ok := that.(MsgUnjailResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + return true +} + +// 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 { + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.CallOption) (*MsgUnjailResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Unjail(ctx context.Context, in *MsgUnjail, opts ...grpc.CallOption) (*MsgUnjailResponse, error) { + out := new(MsgUnjailResponse) + err := c.cc.Invoke(ctx, "/cosmos.slashing.v1beta1.Msg/Unjail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Unjail defines a method for unjailing a jailed validator, thus returning + // them into the bonded validator set, so they can begin receiving provisions + // and rewards again. + Unjail(context.Context, *MsgUnjail) (*MsgUnjailResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Unjail(ctx context.Context, req *MsgUnjail) (*MsgUnjailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unjail not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Unjail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUnjail) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Unjail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.slashing.v1beta1.Msg/Unjail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Unjail(ctx, req.(*MsgUnjail)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.slashing.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Unjail", + Handler: _Msg_Unjail_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/slashing/v1beta1/tx.proto", +} + func (m *MsgUnjail) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -142,6 +293,29 @@ func (m *MsgUnjail) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUnjailResponse) 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 *MsgUnjailResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnjailResponse) 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 @@ -166,6 +340,15 @@ func (m *MsgUnjail) Size() (n int) { return n } +func (m *MsgUnjailResponse) 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 } @@ -257,6 +440,59 @@ func (m *MsgUnjail) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUnjailResponse) 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: MsgUnjailResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnjailResponse: 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 67c15530ebaa22599774c5dc0f10b0116c3abfac Mon Sep 17 00:00:00 2001 From: Cory Date: Mon, 19 Oct 2020 02:22:56 -0700 Subject: [PATCH 07/12] Refactor x/auth/vesting to use ADR-031 (#7551) * update auth/vesting module to use proto msg services * rm accidental tmp files * Update x/auth/vesting/msg_server.go Co-authored-by: Marie Gauthier * golangci-lint fix Co-authored-by: Marie Gauthier Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- proto/cosmos/vesting/v1beta1/tx.proto | 12 ++ x/auth/vesting/handler.go | 77 +------- x/auth/vesting/msg_server.go | 100 ++++++++++ x/auth/vesting/types/tx.pb.go | 264 +++++++++++++++++++++++--- 4 files changed, 356 insertions(+), 97 deletions(-) create mode 100644 x/auth/vesting/msg_server.go diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 0c5ce53ac8cf..41873315c05f 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -6,6 +6,15 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; + +// Msg defines the bank Msg service. +service Msg { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); +} + + // MsgCreateVestingAccount defines a message that enables creating a vesting // account. message MsgCreateVestingAccount { @@ -19,3 +28,6 @@ message MsgCreateVestingAccount { int64 end_time = 4 [(gogoproto.moretags) = "yaml:\"end_time\""]; bool delayed = 5; } + +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +message MsgCreateVestingAccountResponse { } \ No newline at end of file diff --git a/x/auth/vesting/handler.go b/x/auth/vesting/handler.go index eef8787bda22..1d32e9969bb5 100644 --- a/x/auth/vesting/handler.go +++ b/x/auth/vesting/handler.go @@ -1,95 +1,26 @@ package vesting import ( - "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/auth/keeper" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" ) // NewHandler returns a handler for x/auth message types. func NewHandler(ak keeper.AccountKeeper, bk types.BankKeeper) sdk.Handler { + msgServer := NewMsgServerImpl(ak, bk) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgCreateVestingAccount: - return handleMsgCreateVestingAccount(ctx, ak, bk, msg) + res, err := msgServer.CreateVestingAccount(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -func handleMsgCreateVestingAccount(ctx sdk.Context, ak keeper.AccountKeeper, bk types.BankKeeper, msg *types.MsgCreateVestingAccount) (*sdk.Result, error) { - if err := bk.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 bk.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) - } - - if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) - } - - baseAccount := ak.NewAccountWithAddress(ctx, to) - if _, ok := baseAccount.(*authtypes.BaseAccount); !ok { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid account type; expected: BaseAccount, got: %T", baseAccount) - } - - baseVestingAccount := types.NewBaseVestingAccount(baseAccount.(*authtypes.BaseAccount), msg.Amount.Sort(), msg.EndTime) - - var acc authtypes.AccountI - - if msg.Delayed { - acc = types.NewDelayedVestingAccountRaw(baseVestingAccount) - } else { - acc = types.NewContinuousVestingAccountRaw(baseVestingAccount, ctx.BlockTime().Unix()) - } - - ak.SetAccount(ctx, acc) - - defer func() { - telemetry.IncrCounter(1, "new", "account") - - for _, a := range msg.Amount { - if a.Amount.IsInt64() { - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", "create_vesting_account"}, - float32(a.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, - ) - } - } - }() - - err = bk.SendCoins(ctx, from, to, msg.Amount) - 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/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go new file mode 100644 index 000000000000..dadd65dbcf1c --- /dev/null +++ b/x/auth/vesting/msg_server.go @@ -0,0 +1,100 @@ +package vesting + +import ( + "context" + + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + + "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/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" +) + +type msgServer struct { + keeper.AccountKeeper + types.BankKeeper +} + +// NewMsgServerImpl returns an implementation of the vesting MsgServer interface, +// wrapping the corresponding AccountKeeper and BankKeeper. +func NewMsgServerImpl(k keeper.AccountKeeper, bk types.BankKeeper) types.MsgServer { + return &msgServer{AccountKeeper: k, BankKeeper: bk} +} + +var _ types.MsgServer = msgServer{} + +func (s msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCreateVestingAccount) (*types.MsgCreateVestingAccountResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + ak := s.AccountKeeper + bk := s.BankKeeper + + if err := bk.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 bk.BlockedAddr(to) { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + } + + if acc := ak.GetAccount(ctx, to); acc != nil { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) + } + + baseAccount := ak.NewAccountWithAddress(ctx, to) + if _, ok := baseAccount.(*authtypes.BaseAccount); !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid account type; expected: BaseAccount, got: %T", baseAccount) + } + + baseVestingAccount := types.NewBaseVestingAccount(baseAccount.(*authtypes.BaseAccount), msg.Amount.Sort(), msg.EndTime) + + var acc authtypes.AccountI + + if msg.Delayed { + acc = types.NewDelayedVestingAccountRaw(baseVestingAccount) + } else { + acc = types.NewContinuousVestingAccountRaw(baseVestingAccount, ctx.BlockTime().Unix()) + } + + ak.SetAccount(ctx, acc) + + defer func() { + telemetry.IncrCounter(1, "new", "account") + + for _, a := range msg.Amount { + if a.Amount.IsInt64() { + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", "create_vesting_account"}, + float32(a.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", a.Denom)}, + ) + } + } + }() + + err = bk.SendCoins(ctx, from, to, msg.Amount) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + ), + ) + + return &types.MsgCreateVestingAccountResponse{}, nil +} diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index b277f3518f70..ab3283c238aa 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/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" @@ -103,37 +108,78 @@ func (m *MsgCreateVestingAccount) GetDelayed() bool { return false } +// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +type MsgCreateVestingAccountResponse struct { +} + +func (m *MsgCreateVestingAccountResponse) Reset() { *m = MsgCreateVestingAccountResponse{} } +func (m *MsgCreateVestingAccountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateVestingAccountResponse) ProtoMessage() {} +func (*MsgCreateVestingAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5338ca97811f9792, []int{1} +} +func (m *MsgCreateVestingAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateVestingAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateVestingAccountResponse.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 *MsgCreateVestingAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateVestingAccountResponse.Merge(m, src) +} +func (m *MsgCreateVestingAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateVestingAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateVestingAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateVestingAccountResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgCreateVestingAccount)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccount") + proto.RegisterType((*MsgCreateVestingAccountResponse)(nil), "cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") } func init() { proto.RegisterFile("cosmos/vesting/v1beta1/tx.proto", fileDescriptor_5338ca97811f9792) } var fileDescriptor_5338ca97811f9792 = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x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 0xe4, 0xf4, 0xe0, - 0xac, 0xe4, 0xce, 0xe3, 0x7d, 0xaa, 0xfd, 0x17, 0xce, 0x6f, 0xce, 0x70, 0x5b, 0x9c, 0x96, 0x2e, - 0x1f, 0xd6, 0x11, 0xc9, 0xde, 0x56, 0xaa, 0x7a, 0xd5, 0x6c, 0x5f, 0x9c, 0x5a, 0xc5, 0xd8, 0xac, - 0x7e, 0xb9, 0xd4, 0x1a, 0xd1, 0x28, 0x76, 0xce, 0xd7, 0xa9, 0x26, 0xbd, 0xbc, 0x6b, 0x66, 0x18, - 0xf1, 0xc9, 0xdc, 0xb3, 0x7c, 0x4a, 0xec, 0x62, 0xab, 0xf8, 0x9c, 0xb1, 0xe0, 0xd1, 0xe6, 0xab, - 0x19, 0x66, 0xb9, 0x81, 0xb9, 0x45, 0xb4, 0x6c, 0xc1, 0x26, 0x8e, 0x83, 0x31, 0x8f, 0x08, 0x56, - 0x6a, 0x3a, 0x30, 0xab, 0x4e, 0x67, 0x9f, 0x6a, 0xff, 0x44, 0xb1, 0x92, 0x31, 0xdc, 0x06, 0x8e, - 0x83, 0xdb, 0x88, 0x60, 0x59, 0x81, 0x8d, 0x00, 0x4f, 0xd1, 0x0a, 0x07, 0xca, 0x1f, 0x1d, 0x98, - 0x4d, 0xb7, 0x84, 0x83, 0xda, 0xe7, 0xb3, 0x06, 0x9c, 0xeb, 0xf5, 0x56, 0x05, 0x9b, 0xad, 0x0a, - 0x3e, 0xb6, 0x2a, 0x78, 0xda, 0xa9, 0xd2, 0x66, 0xa7, 0x4a, 0x6f, 0x3b, 0x55, 0xba, 0xef, 0xff, - 0xda, 0x6d, 0x69, 0xa3, 0x39, 0x9f, 0x1c, 0x0e, 0x9d, 0x57, 0xf5, 0xea, 0xf9, 0x59, 0x2e, 0xbf, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x22, 0x3f, 0x4e, 0xe2, 0x07, 0x02, 0x00, 0x00, + // 410 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0xbd, 0xae, 0xd3, 0x30, + 0x14, 0x8e, 0x6f, 0x2e, 0xf7, 0xc7, 0x17, 0x09, 0x91, 0x16, 0x1a, 0x3a, 0xc4, 0x21, 0x53, 0x16, + 0x6c, 0x5a, 0x90, 0x90, 0xba, 0x35, 0x1d, 0x51, 0x97, 0x08, 0x31, 0xb0, 0x54, 0x4e, 0x62, 0xd2, + 0x88, 0x26, 0xae, 0x62, 0xb7, 0x6a, 0x37, 0x46, 0x46, 0x1e, 0x81, 0x99, 0xa7, 0x60, 0xec, 0xd8, + 0x91, 0x29, 0xa0, 0x76, 0x61, 0xee, 0x13, 0xa0, 0xc4, 0x49, 0x61, 0x68, 0x91, 0x98, 0xec, 0xa3, + 0xef, 0xc7, 0xe7, 0x7c, 0x3e, 0x10, 0x85, 0x5c, 0xa4, 0x5c, 0x90, 0x25, 0x13, 0x32, 0xc9, 0x62, + 0xb2, 0xec, 0x05, 0x4c, 0xd2, 0x1e, 0x91, 0x2b, 0x3c, 0xcf, 0xb9, 0xe4, 0xc6, 0x63, 0x45, 0xc0, + 0x35, 0x01, 0xd7, 0x84, 0x6e, 0x3b, 0xe6, 0x31, 0xaf, 0x28, 0xa4, 0xbc, 0x29, 0x76, 0xd7, 0xaa, + 0xed, 0x02, 0x2a, 0xd8, 0xd1, 0x2b, 0xe4, 0x49, 0xa6, 0x70, 0xe7, 0xdb, 0x05, 0xec, 0x8c, 0x45, + 0x3c, 0xca, 0x19, 0x95, 0xec, 0xad, 0xb2, 0x1c, 0x86, 0x21, 0x5f, 0x64, 0xd2, 0x18, 0xc0, 0xfb, + 0xef, 0x73, 0x9e, 0x4e, 0x68, 0x14, 0xe5, 0x4c, 0x08, 0x13, 0xd8, 0xc0, 0xbd, 0xf5, 0x3a, 0x87, + 0x02, 0xb5, 0xd6, 0x34, 0x9d, 0x0d, 0x9c, 0xbf, 0x51, 0xc7, 0xbf,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b6, 0xdd, 0x5b, 0xda, 0xf7, 0xbd, 0xa5, 0xbd, 0xeb, 0xfd, 0x33, 0xc9, 0x15, 0xa1, + 0x0b, 0x39, 0x3d, 0xae, 0x65, 0x15, 0x6c, 0x70, 0x55, 0x2d, 0xd1, 0x8b, 0xdf, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xe7, 0x28, 0xaf, 0xe5, 0xb5, 0x02, 0x00, 0x00, } func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { @@ -177,6 +223,91 @@ func (this *MsgCreateVestingAccount) Equal(that interface{}) bool { } return true } + +// 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 { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateVestingAccount(ctx context.Context, in *MsgCreateVestingAccount, opts ...grpc.CallOption) (*MsgCreateVestingAccountResponse, error) { + out := new(MsgCreateVestingAccountResponse) + err := c.cc.Invoke(ctx, "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateVestingAccount defines a method that enables creating a vesting + // account. + CreateVestingAccount(context.Context, *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateVestingAccount(ctx context.Context, req *MsgCreateVestingAccount) (*MsgCreateVestingAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateVestingAccount not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateVestingAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateVestingAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateVestingAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateVestingAccount(ctx, req.(*MsgCreateVestingAccount)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.vesting.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateVestingAccount", + Handler: _Msg_CreateVestingAccount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/vesting/v1beta1/tx.proto", +} + func (m *MsgCreateVestingAccount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -243,6 +374,29 @@ func (m *MsgCreateVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgCreateVestingAccountResponse) 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 *MsgCreateVestingAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateVestingAccountResponse) 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 @@ -283,6 +437,15 @@ func (m *MsgCreateVestingAccount) Size() (n int) { return n } +func (m *MsgCreateVestingAccountResponse) 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 } @@ -479,6 +642,59 @@ func (m *MsgCreateVestingAccount) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCreateVestingAccountResponse) 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: MsgCreateVestingAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateVestingAccountResponse: 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 cfd51cf973e7516f40de554d419535f63336f740 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Fri, 16 Oct 2020 20:23:49 +0530 Subject: [PATCH 08/12] Refactor x/staking according to ADR 031 (#7556) * Refactor x/staking according to ADR 031 * lint * review changes * review changes * review changes Co-authored-by: Aaron Craelius --- proto/cosmos/staking/v1beta1/tx.proto | 53 +- x/distribution/handler.go | 4 +- x/distribution/keeper/msg_server.go | 2 +- x/staking/handler.go | 353 +------- x/staking/handler_test.go | 71 +- x/staking/keeper/msg_server.go | 350 ++++++++ x/staking/types/tx.pb.go | 1092 +++++++++++++++++++++++-- 7 files changed, 1473 insertions(+), 452 deletions(-) create mode 100644 x/staking/keeper/msg_server.go diff --git a/proto/cosmos/staking/v1beta1/tx.proto b/proto/cosmos/staking/v1beta1/tx.proto index 4eb3c8418a4b..c68e037dca3d 100644 --- a/proto/cosmos/staking/v1beta1/tx.proto +++ b/proto/cosmos/staking/v1beta1/tx.proto @@ -3,11 +3,33 @@ package cosmos.staking.v1beta1; import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; import "cosmos/staking/v1beta1/staking.proto"; option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; -// MsgCreateValidator defines an SDK message for creating a new validator. +// Msg defines the staking Msg service. +service Msg { + // CreateValidator defines a method for creating a new validator. + rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); + + // EditValidator defines a method for editing an existing validator. + rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); + + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); + + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); + + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); +} + +// MsgCreateValidator defines a SDK message for creating a new validator. message MsgCreateValidator { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -25,7 +47,10 @@ message MsgCreateValidator { cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; } -// MsgEditValidator defines an SDK message for editing an existing validator. +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +message MsgCreateValidatorResponse { } + +// MsgEditValidator defines a SDK message for editing an existing validator. message MsgEditValidator { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; @@ -48,7 +73,10 @@ message MsgEditValidator { ]; } -// MsgDelegate defines an SDK message for performing a delegation of coins +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +message MsgEditValidatorResponse { } + +// MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. message MsgDelegate { option (gogoproto.equal) = false; @@ -59,7 +87,10 @@ message MsgDelegate { cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; } -// MsgBeginRedelegate defines an SDK message for performing a redelegation +// MsgDelegateResponse defines the Msg/Delegate response type. +message MsgDelegateResponse { } + +// MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. message MsgBeginRedelegate { option (gogoproto.equal) = false; @@ -71,7 +102,12 @@ message MsgBeginRedelegate { cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; } -// MsgUndelegate defines an SDK message for performing an undelegation from a +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +message MsgBeginRedelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. message MsgUndelegate { option (gogoproto.equal) = false; @@ -80,4 +116,9 @@ message MsgUndelegate { string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; -} \ No newline at end of file +} + +// MsgUndelegateResponse defines the Msg/Undelegate response type. +message MsgUndelegateResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/x/distribution/handler.go b/x/distribution/handler.go index e89b9fbf8c06..279a6bf726de 100644 --- a/x/distribution/handler.go +++ b/x/distribution/handler.go @@ -9,11 +9,11 @@ import ( ) func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + 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.MsgSetWithdrawAddress: res, err := msgServer.SetWithdrawAddress(sdk.WrapSDKContext(ctx), msg) diff --git a/x/distribution/keeper/msg_server.go b/x/distribution/keeper/msg_server.go index 9aa24529d8e7..017aeeb216bf 100644 --- a/x/distribution/keeper/msg_server.go +++ b/x/distribution/keeper/msg_server.go @@ -13,7 +13,7 @@ type msgServer struct { Keeper } -// NewMsgServerImpl returns an implementation of the bank MsgServer interface +// NewMsgServerImpl returns an implementation of the distribution MsgServer interface // for the provided Keeper. func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{Keeper: keeper} diff --git a/x/staking/handler.go b/x/staking/handler.go index 4da6b05a6654..6d89c7a29c53 100644 --- a/x/staking/handler.go +++ b/x/staking/handler.go @@ -1,13 +1,6 @@ package staking import ( - "time" - - metrics "github.com/armon/go-metrics" - gogotypes "github.com/gogo/protobuf/types" - tmstrings "github.com/tendermint/tendermint/libs/strings" - - "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/staking/keeper" @@ -15,356 +8,34 @@ import ( ) func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgCreateValidator: - return handleMsgCreateValidator(ctx, msg, k) + res, err := msgServer.CreateValidator(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgEditValidator: - return handleMsgEditValidator(ctx, msg, k) + res, err := msgServer.EditValidator(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgDelegate: - return handleMsgDelegate(ctx, msg, k) + res, err := msgServer.Delegate(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgBeginRedelegate: - return handleMsgBeginRedelegate(ctx, msg, k) + res, err := msgServer.BeginRedelegate(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *types.MsgUndelegate: - return handleMsgUndelegate(ctx, msg, k) + res, err := msgServer.Undelegate(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -// These functions assume everything has been authenticated, -// now we just perform action and save - -func handleMsgCreateValidator(ctx sdk.Context, msg *types.MsgCreateValidator, k keeper.Keeper) (*sdk.Result, error) { - - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - - // check to see if the pubkey or sender has been registered before - if _, found := k.GetValidator(ctx, valAddr); found { - return nil, types.ErrValidatorOwnerExists - } - - pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, msg.Pubkey) - if err != nil { - return nil, err - } - - if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { - return nil, types.ErrValidatorPubKeyExists - } - - bondDenom := k.BondDenom(ctx) - if msg.Value.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Value.Denom, bondDenom) - } - - if _, err := msg.Description.EnsureLength(); err != nil { - return nil, err - } - - cp := ctx.ConsensusParams() - if cp != nil && cp.Validator != nil { - if !tmstrings.StringInSlice(pk.Type(), cp.Validator.PubKeyTypes) { - return nil, sdkerrors.Wrapf( - types.ErrValidatorPubKeyTypeNotSupported, - "got: %s, expected: %s", pk.Type(), cp.Validator.PubKeyTypes, - ) - } - } - - validator := types.NewValidator(valAddr, pk, msg.Description) - commission := types.NewCommissionWithTime( - msg.Commission.Rate, msg.Commission.MaxRate, - msg.Commission.MaxChangeRate, ctx.BlockHeader().Time, - ) - - validator, err = validator.SetInitialCommission(commission) - if err != nil { - return nil, err - } - - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - - validator.MinSelfDelegation = msg.MinSelfDelegation - - k.SetValidator(ctx, validator) - k.SetValidatorByConsAddr(ctx, validator) - k.SetNewValidatorByPowerIndex(ctx, validator) - - // call the after-creation hook - k.AfterValidatorCreated(ctx, validator.GetOperator()) - - // move coins from the msg.Address account to a (self-delegation) delegator account - // the validator account and global shares are updated within here - // NOTE source will always be from a wallet which are unbonded - _, err = k.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) - if err != nil { - return nil, err - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateValidator, - sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Value.Amount.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgEditValidator(ctx sdk.Context, msg *types.MsgEditValidator, k keeper.Keeper) (*sdk.Result, error) { - valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - // validator must already be registered - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound - } - - // replace all editable fields (clients should autofill existing values) - description, err := validator.Description.UpdateDescription(msg.Description) - if err != nil { - return nil, err - } - - validator.Description = description - - if msg.CommissionRate != nil { - commission, err := k.UpdateValidatorCommission(ctx, validator, *msg.CommissionRate) - if err != nil { - return nil, err - } - - // call the before-modification hook since we're about to update the commission - k.BeforeValidatorModified(ctx, valAddr) - - validator.Commission = commission - } - - if msg.MinSelfDelegation != nil { - if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) { - return nil, types.ErrMinSelfDelegationDecreased - } - - if msg.MinSelfDelegation.GT(validator.Tokens) { - return nil, types.ErrSelfDelegationBelowMinimum - } - - validator.MinSelfDelegation = (*msg.MinSelfDelegation) - } - - k.SetValidator(ctx, validator) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeEditValidator, - sdk.NewAttribute(types.AttributeKeyCommissionRate, validator.Commission.String()), - sdk.NewAttribute(types.AttributeKeyMinSelfDelegation, validator.MinSelfDelegation.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgDelegate(ctx sdk.Context, msg *types.MsgDelegate, k keeper.Keeper) (*sdk.Result, error) { - valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if valErr != nil { - return nil, valErr - } - - validator, found := k.GetValidator(ctx, valAddr) - if !found { - return nil, types.ErrNoValidatorFound - } - - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - - bondDenom := k.BondDenom(ctx) - if msg.Amount.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) - } - - // NOTE: source funds are always unbonded - _, err = k.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) - if err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounter(1, types.ModuleName, "delegate") - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, - ) - }() - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeDelegate, - sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgUndelegate(ctx sdk.Context, msg *types.MsgUndelegate, k keeper.Keeper) (*sdk.Result, error) { - addr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) - if err != nil { - return nil, err - } - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - shares, err := k.ValidateUnbondAmount( - ctx, delegatorAddress, addr, msg.Amount.Amount, - ) - if err != nil { - return nil, err - } - - bondDenom := k.BondDenom(ctx) - if msg.Amount.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) - } - - completionTime, err := k.Undelegate(ctx, delegatorAddress, addr, shares) - if err != nil { - return nil, err - } - - ts, err := gogotypes.TimestampProto(completionTime) - if err != nil { - return nil, types.ErrBadRedelegationAddr - } - - defer func() { - telemetry.IncrCounter(1, types.ModuleName, "undelegate") - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, - ) - }() - - completionTimeBz := types.ModuleCdc.MustMarshalBinaryLengthPrefixed(ts) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeUnbond, - sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), - sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Data: completionTimeBz, Events: ctx.EventManager().ABCIEvents()}, nil -} - -func handleMsgBeginRedelegate(ctx sdk.Context, msg *types.MsgBeginRedelegate, k keeper.Keeper) (*sdk.Result, error) { - valSrcAddr, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) - if err != nil { - return nil, err - } - delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) - if err != nil { - return nil, err - } - shares, err := k.ValidateUnbondAmount( - ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, - ) - if err != nil { - return nil, err - } - - bondDenom := k.BondDenom(ctx) - if msg.Amount.Denom != bondDenom { - return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) - } - - valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) - if err != nil { - return nil, err - } - - completionTime, err := k.BeginRedelegation( - ctx, delegatorAddress, valSrcAddr, valDstAddr, shares, - ) - if err != nil { - return nil, err - } - - ts, err := gogotypes.TimestampProto(completionTime) - if err != nil { - return nil, types.ErrBadRedelegationAddr - } - - defer func() { - telemetry.IncrCounter(1, types.ModuleName, "redelegate") - telemetry.SetGaugeWithLabels( - []string{"tx", "msg", msg.Type()}, - float32(msg.Amount.Amount.Int64()), - []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, - ) - }() - - completionTimeBz := types.ModuleCdc.MustMarshalBinaryLengthPrefixed(ts) - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeRedelegate, - sdk.NewAttribute(types.AttributeKeySrcValidator, msg.ValidatorSrcAddress), - sdk.NewAttribute(types.AttributeKeyDstValidator, msg.ValidatorDstAddress), - sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), - sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), - ), - }) - - return &sdk.Result{Data: completionTimeBz, Events: ctx.EventManager().ABCIEvents()}, nil -} diff --git a/x/staking/handler_test.go b/x/staking/handler_test.go index 8114355d90e2..51a7323ca0ab 100644 --- a/x/staking/handler_test.go +++ b/x/staking/handler_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - gogotypes "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" @@ -21,6 +20,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/keeper" "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/golang/protobuf/proto" ) func bootstrapHandlerGenesisTest(t *testing.T, power int64, numAddrs int, accAmount int64) (*simapp.SimApp, sdk.Context, []sdk.AccAddress, []sdk.ValAddress) { @@ -117,13 +117,11 @@ func TestValidatorByPowerIndex(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) staking.EndBlocker(ctx, app.StakingKeeper) @@ -255,13 +253,11 @@ func TestLegacyValidatorDelegations(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // verify the validator record still exists, is jailed, and has correct tokens @@ -500,13 +496,11 @@ func TestIncrementsMsgUnbond(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // check that the accounts and the bond account have the appropriate values @@ -618,10 +612,8 @@ func TestMultipleMsgCreateValidator(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - _, err = gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) // adds validator into unbonding queue @@ -676,13 +668,11 @@ func TestMultipleMsgDelegate(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // check that the account is unbonded @@ -715,13 +705,11 @@ func TestJailValidator(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) validator, found := app.StakingKeeper.GetValidator(ctx, validatorAddr) @@ -735,13 +723,10 @@ func TestJailValidator(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts = &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err = gogotypes.TimestampFromProto(ts) + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) // verify that the pubkey can now be reused @@ -783,13 +768,11 @@ func TestValidatorQueue(t *testing.T) { require.NoError(t, err) require.NotNil(t, res) - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime) + ctx = ctx.WithBlockTime(resData.CompletionTime) staking.EndBlocker(ctx, app.StakingKeeper) origHeader := ctx.BlockHeader() @@ -889,13 +872,11 @@ func TestUnbondingFromUnbondingValidator(t *testing.T) { require.NotNil(t, res) // change the ctx to Block Time one second before the validator would have unbonded - ts := &gogotypes.Timestamp{} - types.ModuleCdc.MustUnmarshalBinaryLengthPrefixed(res.Data, ts) - - finishTime, err := gogotypes.TimestampFromProto(ts) + var resData types.MsgUndelegateResponse + err = proto.Unmarshal(res.Data, &resData) require.NoError(t, err) - ctx = ctx.WithBlockTime(finishTime.Add(time.Second * -1)) + ctx = ctx.WithBlockTime(resData.CompletionTime.Add(time.Second * -1)) // unbond the delegator from the validator msgUndelegateDelegator := types.NewMsgUndelegate(delegatorAddr, validatorAddr, unbondAmt) diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go new file mode 100644 index 000000000000..d4084402265e --- /dev/null +++ b/x/staking/keeper/msg_server.go @@ -0,0 +1,350 @@ +package keeper + +import ( + "context" + "time" + + metrics "github.com/armon/go-metrics" + tmstrings "github.com/tendermint/tendermint/libs/strings" + + "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/staking/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) CreateValidator(goCtx context.Context, msg *types.MsgCreateValidator) (*types.MsgCreateValidatorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + + // check to see if the pubkey or sender has been registered before + if _, found := k.GetValidator(ctx, valAddr); found { + return nil, types.ErrValidatorOwnerExists + } + + pk, err := sdk.GetPubKeyFromBech32(sdk.Bech32PubKeyTypeConsPub, msg.Pubkey) + if err != nil { + return nil, err + } + + if _, found := k.GetValidatorByConsAddr(ctx, sdk.GetConsAddress(pk)); found { + return nil, types.ErrValidatorPubKeyExists + } + + bondDenom := k.BondDenom(ctx) + if msg.Value.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Value.Denom, bondDenom) + } + + if _, err := msg.Description.EnsureLength(); err != nil { + return nil, err + } + + cp := ctx.ConsensusParams() + if cp != nil && cp.Validator != nil { + if !tmstrings.StringInSlice(pk.Type(), cp.Validator.PubKeyTypes) { + return nil, sdkerrors.Wrapf( + types.ErrValidatorPubKeyTypeNotSupported, + "got: %s, expected: %s", pk.Type(), cp.Validator.PubKeyTypes, + ) + } + } + + validator := types.NewValidator(valAddr, pk, msg.Description) + commission := types.NewCommissionWithTime( + msg.Commission.Rate, msg.Commission.MaxRate, + msg.Commission.MaxChangeRate, ctx.BlockHeader().Time, + ) + + validator, err = validator.SetInitialCommission(commission) + if err != nil { + return nil, err + } + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + validator.MinSelfDelegation = msg.MinSelfDelegation + + k.SetValidator(ctx, validator) + k.SetValidatorByConsAddr(ctx, validator) + k.SetNewValidatorByPowerIndex(ctx, validator) + + // call the after-creation hook + k.AfterValidatorCreated(ctx, validator.GetOperator()) + + // move coins from the msg.Address account to a (self-delegation) delegator account + // the validator account and global shares are updated within here + // NOTE source will always be from a wallet which are unbonded + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Value.Amount, types.Unbonded, validator, true) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeCreateValidator, + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Value.Amount.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgCreateValidatorResponse{}, nil +} + +func (k msgServer) EditValidator(goCtx context.Context, msg *types.MsgEditValidator) (*types.MsgEditValidatorResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + valAddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + // validator must already be registered + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + // replace all editable fields (clients should autofill existing values) + description, err := validator.Description.UpdateDescription(msg.Description) + if err != nil { + return nil, err + } + + validator.Description = description + + if msg.CommissionRate != nil { + commission, err := k.UpdateValidatorCommission(ctx, validator, *msg.CommissionRate) + if err != nil { + return nil, err + } + + // call the before-modification hook since we're about to update the commission + k.BeforeValidatorModified(ctx, valAddr) + + validator.Commission = commission + } + + if msg.MinSelfDelegation != nil { + if !msg.MinSelfDelegation.GT(validator.MinSelfDelegation) { + return nil, types.ErrMinSelfDelegationDecreased + } + + if msg.MinSelfDelegation.GT(validator.Tokens) { + return nil, types.ErrSelfDelegationBelowMinimum + } + + validator.MinSelfDelegation = (*msg.MinSelfDelegation) + } + + k.SetValidator(ctx, validator) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeEditValidator, + sdk.NewAttribute(types.AttributeKeyCommissionRate, validator.Commission.String()), + sdk.NewAttribute(types.AttributeKeyMinSelfDelegation, validator.MinSelfDelegation.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.ValidatorAddress), + ), + }) + + return &types.MsgEditValidatorResponse{}, nil +} + +func (k msgServer) Delegate(goCtx context.Context, msg *types.MsgDelegate) (*types.MsgDelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + valAddr, valErr := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if valErr != nil { + return nil, valErr + } + + validator, found := k.GetValidator(ctx, valAddr) + if !found { + return nil, types.ErrNoValidatorFound + } + + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + + bondDenom := k.BondDenom(ctx) + if msg.Amount.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) + } + + // NOTE: source funds are always unbonded + _, err = k.Keeper.Delegate(ctx, delegatorAddress, msg.Amount.Amount, types.Unbonded, validator, true) + if err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "delegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(msg.Amount.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, + ) + }() + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeDelegate, + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgDelegateResponse{}, nil +} + +func (k msgServer) BeginRedelegate(goCtx context.Context, msg *types.MsgBeginRedelegate) (*types.MsgBeginRedelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + valSrcAddr, err := sdk.ValAddressFromBech32(msg.ValidatorSrcAddress) + if err != nil { + return nil, err + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + shares, err := k.ValidateUnbondAmount( + ctx, delegatorAddress, valSrcAddr, msg.Amount.Amount, + ) + if err != nil { + return nil, err + } + + bondDenom := k.BondDenom(ctx) + if msg.Amount.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) + } + + valDstAddr, err := sdk.ValAddressFromBech32(msg.ValidatorDstAddress) + if err != nil { + return nil, err + } + + completionTime, err := k.BeginRedelegation( + ctx, delegatorAddress, valSrcAddr, valDstAddr, shares, + ) + if err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "redelegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(msg.Amount.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, + ) + }() + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeRedelegate, + sdk.NewAttribute(types.AttributeKeySrcValidator, msg.ValidatorSrcAddress), + sdk.NewAttribute(types.AttributeKeyDstValidator, msg.ValidatorDstAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), + sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgBeginRedelegateResponse{ + CompletionTime: completionTime, + }, nil +} + +func (k msgServer) Undelegate(goCtx context.Context, msg *types.MsgUndelegate) (*types.MsgUndelegateResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + addr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) + if err != nil { + return nil, err + } + delegatorAddress, err := sdk.AccAddressFromBech32(msg.DelegatorAddress) + if err != nil { + return nil, err + } + shares, err := k.ValidateUnbondAmount( + ctx, delegatorAddress, addr, msg.Amount.Amount, + ) + if err != nil { + return nil, err + } + + bondDenom := k.BondDenom(ctx) + if msg.Amount.Denom != bondDenom { + return nil, sdkerrors.Wrapf(types.ErrBadDenom, "got %s, expected %s", msg.Amount.Denom, bondDenom) + } + + completionTime, err := k.Keeper.Undelegate(ctx, delegatorAddress, addr, shares) + if err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounter(1, types.ModuleName, "undelegate") + telemetry.SetGaugeWithLabels( + []string{"tx", "msg", msg.Type()}, + float32(msg.Amount.Amount.Int64()), + []metrics.Label{telemetry.NewLabel("denom", msg.Amount.Denom)}, + ) + }() + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeUnbond, + sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress), + sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.Amount.String()), + sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.DelegatorAddress), + ), + }) + + return &types.MsgUndelegateResponse{ + CompletionTime: completionTime, + }, nil +} diff --git a/x/staking/types/tx.pb.go b/x/staking/types/tx.pb.go index 07c643c7dc3c..d2d26bd25116 100644 --- a/x/staking/types/tx.pb.go +++ b/x/staking/types/tx.pb.go @@ -4,20 +4,29 @@ package types import ( + context "context" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/timestamp" + 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" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -25,7 +34,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// MsgCreateValidator defines an SDK message for creating a new validator. +// MsgCreateValidator defines a SDK message for creating a new validator. type MsgCreateValidator struct { Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` Commission CommissionRates `protobuf:"bytes,2,opt,name=commission,proto3" json:"commission"` @@ -69,7 +78,44 @@ func (m *MsgCreateValidator) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCreateValidator proto.InternalMessageInfo -// MsgEditValidator defines an SDK message for editing an existing validator. +// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +type MsgCreateValidatorResponse struct { +} + +func (m *MsgCreateValidatorResponse) Reset() { *m = MsgCreateValidatorResponse{} } +func (m *MsgCreateValidatorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateValidatorResponse) ProtoMessage() {} +func (*MsgCreateValidatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{1} +} +func (m *MsgCreateValidatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateValidatorResponse.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 *MsgCreateValidatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateValidatorResponse.Merge(m, src) +} +func (m *MsgCreateValidatorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateValidatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateValidatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateValidatorResponse proto.InternalMessageInfo + +// MsgEditValidator defines a SDK message for editing an existing validator. type MsgEditValidator struct { Description Description `protobuf:"bytes,1,opt,name=description,proto3" json:"description"` ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"address"` @@ -86,7 +132,7 @@ func (m *MsgEditValidator) Reset() { *m = MsgEditValidator{} } func (m *MsgEditValidator) String() string { return proto.CompactTextString(m) } func (*MsgEditValidator) ProtoMessage() {} func (*MsgEditValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{1} + return fileDescriptor_0926ef28816b35ab, []int{2} } func (m *MsgEditValidator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -115,7 +161,44 @@ func (m *MsgEditValidator) XXX_DiscardUnknown() { var xxx_messageInfo_MsgEditValidator proto.InternalMessageInfo -// MsgDelegate defines an SDK message for performing a delegation of coins +// MsgEditValidatorResponse defines the Msg/EditValidator response type. +type MsgEditValidatorResponse struct { +} + +func (m *MsgEditValidatorResponse) Reset() { *m = MsgEditValidatorResponse{} } +func (m *MsgEditValidatorResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEditValidatorResponse) ProtoMessage() {} +func (*MsgEditValidatorResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{3} +} +func (m *MsgEditValidatorResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditValidatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditValidatorResponse.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 *MsgEditValidatorResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditValidatorResponse.Merge(m, src) +} +func (m *MsgEditValidatorResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEditValidatorResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditValidatorResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditValidatorResponse proto.InternalMessageInfo + +// MsgDelegate defines a SDK message for performing a delegation of coins // from a delegator to a validator. type MsgDelegate struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` @@ -127,7 +210,7 @@ func (m *MsgDelegate) Reset() { *m = MsgDelegate{} } func (m *MsgDelegate) String() string { return proto.CompactTextString(m) } func (*MsgDelegate) ProtoMessage() {} func (*MsgDelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{2} + return fileDescriptor_0926ef28816b35ab, []int{4} } func (m *MsgDelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,7 +239,44 @@ func (m *MsgDelegate) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDelegate proto.InternalMessageInfo -// MsgBeginRedelegate defines an SDK message for performing a redelegation +// MsgDelegateResponse defines the Msg/Delegate response type. +type MsgDelegateResponse struct { +} + +func (m *MsgDelegateResponse) Reset() { *m = MsgDelegateResponse{} } +func (m *MsgDelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDelegateResponse) ProtoMessage() {} +func (*MsgDelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{5} +} +func (m *MsgDelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDelegateResponse.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 *MsgDelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDelegateResponse.Merge(m, src) +} +func (m *MsgDelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDelegateResponse proto.InternalMessageInfo + +// MsgBeginRedelegate defines a SDK message for performing a redelegation // of coins from a delegator and source validator to a destination validator. type MsgBeginRedelegate struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` @@ -169,7 +289,7 @@ func (m *MsgBeginRedelegate) Reset() { *m = MsgBeginRedelegate{} } func (m *MsgBeginRedelegate) String() string { return proto.CompactTextString(m) } func (*MsgBeginRedelegate) ProtoMessage() {} func (*MsgBeginRedelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{3} + return fileDescriptor_0926ef28816b35ab, []int{6} } func (m *MsgBeginRedelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -198,7 +318,52 @@ func (m *MsgBeginRedelegate) XXX_DiscardUnknown() { var xxx_messageInfo_MsgBeginRedelegate proto.InternalMessageInfo -// MsgUndelegate defines an SDK message for performing an undelegation from a +// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +type MsgBeginRedelegateResponse struct { + CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` +} + +func (m *MsgBeginRedelegateResponse) Reset() { *m = MsgBeginRedelegateResponse{} } +func (m *MsgBeginRedelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBeginRedelegateResponse) ProtoMessage() {} +func (*MsgBeginRedelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{7} +} +func (m *MsgBeginRedelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBeginRedelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBeginRedelegateResponse.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 *MsgBeginRedelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBeginRedelegateResponse.Merge(m, src) +} +func (m *MsgBeginRedelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBeginRedelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBeginRedelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBeginRedelegateResponse proto.InternalMessageInfo + +func (m *MsgBeginRedelegateResponse) GetCompletionTime() time.Time { + if m != nil { + return m.CompletionTime + } + return time.Time{} +} + +// MsgUndelegate defines a SDK message for performing an undelegation from a // delegate and a validator. type MsgUndelegate struct { DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` @@ -210,7 +375,7 @@ func (m *MsgUndelegate) Reset() { *m = MsgUndelegate{} } func (m *MsgUndelegate) String() string { return proto.CompactTextString(m) } func (*MsgUndelegate) ProtoMessage() {} func (*MsgUndelegate) Descriptor() ([]byte, []int) { - return fileDescriptor_0926ef28816b35ab, []int{4} + return fileDescriptor_0926ef28816b35ab, []int{8} } func (m *MsgUndelegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -239,57 +404,359 @@ func (m *MsgUndelegate) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUndelegate proto.InternalMessageInfo +// MsgUndelegateResponse defines the Msg/Undelegate response type. +type MsgUndelegateResponse struct { + CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` +} + +func (m *MsgUndelegateResponse) Reset() { *m = MsgUndelegateResponse{} } +func (m *MsgUndelegateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUndelegateResponse) ProtoMessage() {} +func (*MsgUndelegateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0926ef28816b35ab, []int{9} +} +func (m *MsgUndelegateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUndelegateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUndelegateResponse.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 *MsgUndelegateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUndelegateResponse.Merge(m, src) +} +func (m *MsgUndelegateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUndelegateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUndelegateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUndelegateResponse proto.InternalMessageInfo + +func (m *MsgUndelegateResponse) GetCompletionTime() time.Time { + if m != nil { + return m.CompletionTime + } + return time.Time{} +} + func init() { proto.RegisterType((*MsgCreateValidator)(nil), "cosmos.staking.v1beta1.MsgCreateValidator") + proto.RegisterType((*MsgCreateValidatorResponse)(nil), "cosmos.staking.v1beta1.MsgCreateValidatorResponse") proto.RegisterType((*MsgEditValidator)(nil), "cosmos.staking.v1beta1.MsgEditValidator") + proto.RegisterType((*MsgEditValidatorResponse)(nil), "cosmos.staking.v1beta1.MsgEditValidatorResponse") proto.RegisterType((*MsgDelegate)(nil), "cosmos.staking.v1beta1.MsgDelegate") + proto.RegisterType((*MsgDelegateResponse)(nil), "cosmos.staking.v1beta1.MsgDelegateResponse") proto.RegisterType((*MsgBeginRedelegate)(nil), "cosmos.staking.v1beta1.MsgBeginRedelegate") + proto.RegisterType((*MsgBeginRedelegateResponse)(nil), "cosmos.staking.v1beta1.MsgBeginRedelegateResponse") proto.RegisterType((*MsgUndelegate)(nil), "cosmos.staking.v1beta1.MsgUndelegate") + proto.RegisterType((*MsgUndelegateResponse)(nil), "cosmos.staking.v1beta1.MsgUndelegateResponse") } func init() { proto.RegisterFile("cosmos/staking/v1beta1/tx.proto", fileDescriptor_0926ef28816b35ab) } var fileDescriptor_0926ef28816b35ab = []byte{ - // 621 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x95, 0xc1, 0x8a, 0xd3, 0x40, - 0x1c, 0xc6, 0x93, 0x6e, 0xb7, 0xea, 0x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 0xc9, 0x48, 0x16, 0x4f, 0x47, 0xb2, - 0xf8, 0x6b, 0x24, 0x8b, 0x5f, 0xc6, 0xb2, 0x70, 0x3a, 0x96, 0x85, 0x1f, 0x63, 0x59, 0xf8, 0xf0, - 0xe0, 0xdc, 0x1b, 0x3a, 0x48, 0x9e, 0xcc, 0xe8, 0xae, 0xb6, 0x0b, 0xd1, 0x4b, 0xf9, 0xf8, 0x4f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x4f, 0x9f, 0xcb, 0x45, 0xc0, 0x07, 0x00, 0x00, + // 815 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x96, 0x4f, 0x6b, 0xdb, 0x48, + 0x18, 0xc6, 0x2d, 0xdb, 0xf1, 0x66, 0x27, 0xe4, 0x9f, 0xb2, 0x09, 0x5e, 0x11, 0xac, 0xa0, 0xec, + 0xb6, 0xa1, 0x6d, 0xa4, 0x26, 0xa5, 0x14, 0x72, 0x29, 0x75, 0xdc, 0xd2, 0xd0, 0xfa, 0xa2, 0xa4, + 0x3d, 0x94, 0x82, 0x91, 0xa5, 0xb1, 0x2a, 0x2c, 0x69, 0x1c, 0xcd, 0x38, 0x24, 0xd0, 0x0f, 0xd0, + 0x63, 0xa0, 0xb7, 0x42, 0x21, 0x1f, 0x27, 0xa7, 0x92, 0x63, 0xe9, 0xc1, 0x2d, 0x09, 0x94, 0x9c, + 0xfd, 0x09, 0x8a, 0x46, 0xd2, 0x58, 0x96, 0x6d, 0x61, 0x42, 0x7d, 0xe9, 0x29, 0xf1, 0xe8, 0x37, + 0xcf, 0x68, 0x9e, 0x79, 0xe6, 0x7d, 0x05, 0x44, 0x1d, 0x61, 0x07, 0x61, 0x05, 0x13, 0xad, 0x69, + 0xb9, 0xa6, 0x72, 0xb4, 0x55, 0x87, 0x44, 0xdb, 0x52, 0xc8, 0xb1, 0xdc, 0xf2, 0x10, 0x41, 0xf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, 0x9d, 0x90, 0xa5, 0xdb, 0x9f, 0xf2, 0x20, 0x57, 0xc5, 0x26, 0x7f, 0x08, 0xe6, 0x93, 0x1f, + 0x01, 0x77, 0x46, 0xd5, 0xec, 0xc1, 0x8e, 0x20, 0x6c, 0x8f, 0xcf, 0xb2, 0x9d, 0x34, 0xc1, 0x6c, + 0x7f, 0xe7, 0xd8, 0x48, 0x11, 0xe9, 0x23, 0x85, 0xfb, 0xe3, 0x92, 0x6c, 0xb1, 0xb7, 0x60, 0x9a, + 0x15, 0xbd, 0xf5, 0x94, 0xd9, 0x11, 0x24, 0xdc, 0x1d, 0x03, 0x62, 0xea, 0x87, 0x60, 0x3e, 0x59, + 0x52, 0xd2, 0xdc, 0x4b, 0xb0, 0xa9, 0xee, 0x8d, 0xba, 0x5a, 0x75, 0x00, 0x62, 0xf7, 0xe0, 0xff, + 0x14, 0x85, 0x1e, 0x26, 0x6c, 0x8e, 0x85, 0x45, 0x6b, 0x94, 0x9f, 0x9d, 0x5f, 0x96, 0xb8, 0x8b, + 0xcb, 0x12, 0xf7, 0xe3, 0xb2, 0xc4, 0x9d, 0x5e, 0x95, 0x32, 0x17, 0x57, 0xa5, 0xcc, 0xd7, 0xab, + 0x52, 0xe6, 0xcd, 0xbd, 0xd4, 0x36, 0x76, 0xcc, 0xbe, 0x3a, 0x69, 0x43, 0xab, 0x17, 0x68, 0x24, + 0x1f, 0xfc, 0x0a, 0x00, 0x00, 0xff, 0xff, 0xdc, 0x72, 0xf7, 0x1e, 0x24, 0x0b, 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 { + // CreateValidator defines a method for creating a new validator. + CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) + // EditValidator defines a method for editing an existing validator. + EditValidator(ctx context.Context, in *MsgEditValidator, opts ...grpc.CallOption) (*MsgEditValidatorResponse, error) + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, opts ...grpc.CallOption) (*MsgBeginRedelegateResponse, error) + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateValidator(ctx context.Context, in *MsgCreateValidator, opts ...grpc.CallOption) (*MsgCreateValidatorResponse, error) { + out := new(MsgCreateValidatorResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/CreateValidator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditValidator(ctx context.Context, in *MsgEditValidator, opts ...grpc.CallOption) (*MsgEditValidatorResponse, error) { + out := new(MsgEditValidatorResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/EditValidator", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Delegate(ctx context.Context, in *MsgDelegate, opts ...grpc.CallOption) (*MsgDelegateResponse, error) { + out := new(MsgDelegateResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/Delegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) BeginRedelegate(ctx context.Context, in *MsgBeginRedelegate, opts ...grpc.CallOption) (*MsgBeginRedelegateResponse, error) { + out := new(MsgBeginRedelegateResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/BeginRedelegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Undelegate(ctx context.Context, in *MsgUndelegate, opts ...grpc.CallOption) (*MsgUndelegateResponse, error) { + out := new(MsgUndelegateResponse) + err := c.cc.Invoke(ctx, "/cosmos.staking.v1beta1.Msg/Undelegate", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateValidator defines a method for creating a new validator. + CreateValidator(context.Context, *MsgCreateValidator) (*MsgCreateValidatorResponse, error) + // EditValidator defines a method for editing an existing validator. + EditValidator(context.Context, *MsgEditValidator) (*MsgEditValidatorResponse, error) + // Delegate defines a method for performing a delegation of coins + // from a delegator to a validator. + Delegate(context.Context, *MsgDelegate) (*MsgDelegateResponse, error) + // BeginRedelegate defines a method for performing a redelegation + // of coins from a delegator and source validator to a destination validator. + BeginRedelegate(context.Context, *MsgBeginRedelegate) (*MsgBeginRedelegateResponse, error) + // Undelegate defines a method for performing an undelegation from a + // delegate and a validator. + Undelegate(context.Context, *MsgUndelegate) (*MsgUndelegateResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateValidator(ctx context.Context, req *MsgCreateValidator) (*MsgCreateValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateValidator not implemented") +} +func (*UnimplementedMsgServer) EditValidator(ctx context.Context, req *MsgEditValidator) (*MsgEditValidatorResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditValidator not implemented") +} +func (*UnimplementedMsgServer) Delegate(ctx context.Context, req *MsgDelegate) (*MsgDelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delegate not implemented") +} +func (*UnimplementedMsgServer) BeginRedelegate(ctx context.Context, req *MsgBeginRedelegate) (*MsgBeginRedelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BeginRedelegate not implemented") +} +func (*UnimplementedMsgServer) Undelegate(ctx context.Context, req *MsgUndelegate) (*MsgUndelegateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Undelegate not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateValidator) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateValidator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/CreateValidator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateValidator(ctx, req.(*MsgCreateValidator)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_EditValidator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditValidator) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditValidator(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/EditValidator", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditValidator(ctx, req.(*MsgEditValidator)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Delegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Delegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/Delegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Delegate(ctx, req.(*MsgDelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_BeginRedelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBeginRedelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).BeginRedelegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/BeginRedelegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).BeginRedelegate(ctx, req.(*MsgBeginRedelegate)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Undelegate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUndelegate) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Undelegate(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.staking.v1beta1.Msg/Undelegate", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Undelegate(ctx, req.(*MsgUndelegate)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.staking.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateValidator", + Handler: _Msg_CreateValidator_Handler, + }, + { + MethodName: "EditValidator", + Handler: _Msg_EditValidator_Handler, + }, + { + MethodName: "Delegate", + Handler: _Msg_Delegate_Handler, + }, + { + MethodName: "BeginRedelegate", + Handler: _Msg_BeginRedelegate_Handler, + }, + { + MethodName: "Undelegate", + Handler: _Msg_Undelegate_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/staking/v1beta1/tx.proto", } func (m *MsgCreateValidator) Marshal() (dAtA []byte, err error) { @@ -376,6 +843,29 @@ func (m *MsgCreateValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgCreateValidatorResponse) 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 *MsgCreateValidatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgEditValidator) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -440,6 +930,29 @@ func (m *MsgEditValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgEditValidatorResponse) 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 *MsgEditValidatorResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditValidatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgDelegate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -487,6 +1000,29 @@ func (m *MsgDelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgDelegateResponse) 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 *MsgDelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgBeginRedelegate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -541,6 +1077,37 @@ func (m *MsgBeginRedelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgBeginRedelegateResponse) 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 *MsgBeginRedelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBeginRedelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *MsgUndelegate) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -588,6 +1155,37 @@ func (m *MsgUndelegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgUndelegateResponse) 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 *MsgUndelegateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUndelegateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintTx(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -628,6 +1226,15 @@ func (m *MsgCreateValidator) Size() (n int) { return n } +func (m *MsgCreateValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgEditValidator) Size() (n int) { if m == nil { return 0 @@ -651,6 +1258,15 @@ func (m *MsgEditValidator) Size() (n int) { return n } +func (m *MsgEditValidatorResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgDelegate) Size() (n int) { if m == nil { return 0 @@ -670,6 +1286,15 @@ func (m *MsgDelegate) Size() (n int) { return n } +func (m *MsgDelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgBeginRedelegate) Size() (n int) { if m == nil { return 0 @@ -693,6 +1318,17 @@ func (m *MsgBeginRedelegate) Size() (n int) { return n } +func (m *MsgBeginRedelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime) + n += 1 + l + sovTx(uint64(l)) + return n +} + func (m *MsgUndelegate) Size() (n int) { if m == nil { return 0 @@ -712,6 +1348,17 @@ func (m *MsgUndelegate) Size() (n int) { return n } +func (m *MsgUndelegateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime) + n += 1 + l + sovTx(uint64(l)) + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1000,6 +1647,59 @@ func (m *MsgCreateValidator) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgCreateValidatorResponse) 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: MsgCreateValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateValidatorResponse: 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 *MsgEditValidator) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1153,19 +1853,72 @@ func (m *MsgEditValidator) Unmarshal(dAtA []byte) error { if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen - if postIndex < 0 { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.MinSelfDelegation = &v + if err := m.MinSelfDelegation.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 postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - var v github_com_cosmos_cosmos_sdk_types.Int - m.MinSelfDelegation = &v - if err := m.MinSelfDelegation.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditValidatorResponse) 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 } - iNdEx = postIndex + 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: MsgEditValidatorResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditValidatorResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1340,6 +2093,59 @@ func (m *MsgDelegate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgDelegateResponse) 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: MsgDelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDelegateResponse: 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 *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1522,6 +2328,92 @@ func (m *MsgBeginRedelegate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgBeginRedelegateResponse) 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: MsgBeginRedelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBeginRedelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, 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 *MsgUndelegate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1672,6 +2564,92 @@ func (m *MsgUndelegate) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUndelegateResponse) 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: MsgUndelegateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUndelegateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From db51b2797e15ea35d919fbd7011937878823c64f Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 19 Oct 2020 13:46:10 -0400 Subject: [PATCH 09/12] Add MsgServer to Configurator for ADR 031 wiring (#7584) * Add MsgServer to Configurator for ADR 031 wiring * Add docs, wire up evidence & staking * Add integration test * Add comments * Doc strings * Update types/module/configurator.go Co-authored-by: Aleksandr Bezobchuk * Update types/module/configurator.go Co-authored-by: Cory * Wire up vesting * Update CHANGELOG.md Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Amaury Martiny Co-authored-by: Cory Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 2 +- simapp/app.go | 2 +- tests/mocks/account_retriever.go | 111 ++++++++++++++++++++++++ types/module/configurator.go | 17 +++- types/module/module_test.go | 3 +- x/auth/vesting/module.go | 6 +- x/bank/client/cli/cli_test.go | 142 +++++++++++++++++++++++++++++++ x/bank/module.go | 4 +- x/crisis/module.go | 7 +- x/distribution/module.go | 4 +- x/evidence/module.go | 4 +- x/gov/module.go | 4 +- x/slashing/module.go | 4 +- x/staking/module.go | 4 +- 14 files changed, 292 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bdb34e5e4bbd..8b1113fdc444 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,7 @@ 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. +* (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) [\#7584](https://github.com/cosmos/cosmos-sdk/pull/7584) 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 diff --git a/simapp/app.go b/simapp/app.go index 7e407af6b8fe..2be1768b452d 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(module.NewConfigurator(app.GRPCQueryRouter())) + app.mm.RegisterServices(module.NewConfigurator(app.MsgServiceRouter(), app.GRPCQueryRouter())) // add test gRPC service for testing gRPC queries in isolation testdata.RegisterQueryServer(app.GRPCQueryRouter(), testdata.QueryImpl{}) diff --git a/tests/mocks/account_retriever.go b/tests/mocks/account_retriever.go index f571fcbd1516..23b02b7dce2b 100644 --- a/tests/mocks/account_retriever.go +++ b/tests/mocks/account_retriever.go @@ -8,9 +8,89 @@ import ( client "github.com/cosmos/cosmos-sdk/client" types "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" + crypto "github.com/tendermint/tendermint/crypto" reflect "reflect" ) +// MockAccount is a mock of Account interface +type MockAccount struct { + ctrl *gomock.Controller + recorder *MockAccountMockRecorder +} + +// MockAccountMockRecorder is the mock recorder for MockAccount +type MockAccountMockRecorder struct { + mock *MockAccount +} + +// NewMockAccount creates a new mock instance +func NewMockAccount(ctrl *gomock.Controller) *MockAccount { + mock := &MockAccount{ctrl: ctrl} + mock.recorder = &MockAccountMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockAccount) EXPECT() *MockAccountMockRecorder { + return m.recorder +} + +// GetAddress mocks base method +func (m *MockAccount) GetAddress() types.AccAddress { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAddress") + ret0, _ := ret[0].(types.AccAddress) + return ret0 +} + +// GetAddress indicates an expected call of GetAddress +func (mr *MockAccountMockRecorder) GetAddress() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAddress", reflect.TypeOf((*MockAccount)(nil).GetAddress)) +} + +// GetPubKey mocks base method +func (m *MockAccount) GetPubKey() crypto.PubKey { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPubKey") + ret0, _ := ret[0].(crypto.PubKey) + return ret0 +} + +// GetPubKey indicates an expected call of GetPubKey +func (mr *MockAccountMockRecorder) GetPubKey() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPubKey", reflect.TypeOf((*MockAccount)(nil).GetPubKey)) +} + +// GetAccountNumber mocks base method +func (m *MockAccount) GetAccountNumber() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccountNumber") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetAccountNumber indicates an expected call of GetAccountNumber +func (mr *MockAccountMockRecorder) GetAccountNumber() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountNumber", reflect.TypeOf((*MockAccount)(nil).GetAccountNumber)) +} + +// GetSequence mocks base method +func (m *MockAccount) GetSequence() uint64 { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetSequence") + ret0, _ := ret[0].(uint64) + return ret0 +} + +// GetSequence indicates an expected call of GetSequence +func (mr *MockAccountMockRecorder) GetSequence() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSequence", reflect.TypeOf((*MockAccount)(nil).GetSequence)) +} + // MockAccountRetriever is a mock of AccountRetriever interface type MockAccountRetriever struct { ctrl *gomock.Controller @@ -34,6 +114,37 @@ func (m *MockAccountRetriever) EXPECT() *MockAccountRetrieverMockRecorder { return m.recorder } +// GetAccount mocks base method +func (m *MockAccountRetriever) GetAccount(clientCtx client.Context, addr types.AccAddress) (client.Account, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccount", clientCtx, addr) + ret0, _ := ret[0].(client.Account) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAccount indicates an expected call of GetAccount +func (mr *MockAccountRetrieverMockRecorder) GetAccount(clientCtx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccount", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccount), clientCtx, addr) +} + +// GetAccountWithHeight mocks base method +func (m *MockAccountRetriever) GetAccountWithHeight(clientCtx client.Context, addr types.AccAddress) (client.Account, int64, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAccountWithHeight", clientCtx, addr) + ret0, _ := ret[0].(client.Account) + ret1, _ := ret[1].(int64) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetAccountWithHeight indicates an expected call of GetAccountWithHeight +func (mr *MockAccountRetrieverMockRecorder) GetAccountWithHeight(clientCtx, addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccountWithHeight", reflect.TypeOf((*MockAccountRetriever)(nil).GetAccountWithHeight), clientCtx, addr) +} + // EnsureExists mocks base method func (m *MockAccountRetriever) EnsureExists(clientCtx client.Context, addr types.AccAddress) error { m.ctrl.T.Helper() diff --git a/types/module/configurator.go b/types/module/configurator.go index efa83607de14..d561dd9eef0d 100644 --- a/types/module/configurator.go +++ b/types/module/configurator.go @@ -7,20 +7,33 @@ import "github.com/gogo/protobuf/grpc" // support module object capabilities isolation as described in // https://github.com/cosmos/cosmos-sdk/issues/7093 type Configurator interface { + // MsgServer returns a grpc.Server instance which allows registering services + // that will handle TxBody.messages in transactions. These Msg's WILL NOT + // be exposed as gRPC services. + MsgServer() grpc.Server + + // QueryServer returns a grpc.Server instance which allows registering services + // that will be exposed as gRPC services as well as ABCI query handlers. QueryServer() grpc.Server } type configurator struct { + msgServer grpc.Server queryServer grpc.Server } // NewConfigurator returns a new Configurator instance -func NewConfigurator(queryServer grpc.Server) Configurator { - return configurator{queryServer: queryServer} +func NewConfigurator(msgServer grpc.Server, queryServer grpc.Server) Configurator { + return configurator{msgServer: msgServer, queryServer: queryServer} } var _ Configurator = configurator{} +// MsgServer implements the Configurator.MsgServer method +func (c configurator) MsgServer() grpc.Server { + return c.msgServer +} + // QueryServer implements the Configurator.QueryServer method func (c configurator) QueryServer() grpc.Server { return c.queryServer diff --git a/types/module/module_test.go b/types/module/module_test.go index 67eac1695587..cc331cf58f2d 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -181,8 +181,9 @@ func TestManager_RegisterQueryServices(t *testing.T) { require.NotNil(t, mm) require.Equal(t, 2, len(mm.Modules)) + msgRouter := mocks.NewMockServer(mockCtrl) queryRouter := mocks.NewMockServer(mockCtrl) - cfg := module.NewConfigurator(queryRouter) + cfg := module.NewConfigurator(msgRouter, queryRouter) mockAppModule1.EXPECT().RegisterServices(cfg).Times(1) mockAppModule2.EXPECT().RegisterServices(cfg).Times(1) diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index b4997d60e4bd..7afab8d34b60 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -100,8 +100,10 @@ func (am AppModule) Route() sdk.Route { // functionality. func (AppModule) QuerierRoute() string { return "" } -// RegisterQueryService performs a no-op. -func (am AppModule) RegisterServices(_ module.Configurator) {} +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), NewMsgServerImpl(am.accountKeeper, am.bankKeeper)) +} // LegacyQuerierHandler performs a no-op. func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier { diff --git a/x/bank/client/cli/cli_test.go b/x/bank/client/cli/cli_test.go index 67f967b44a38..c68be4ccd348 100644 --- a/x/bank/client/cli/cli_test.go +++ b/x/bank/client/cli/cli_test.go @@ -5,6 +5,13 @@ import ( "fmt" "testing" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client/tx" + + "github.com/gogo/protobuf/grpc" + grpc2 "google.golang.org/grpc" + "github.com/gogo/protobuf/proto" "github.com/stretchr/testify/suite" tmcli "github.com/tendermint/tendermint/libs/cli" @@ -295,6 +302,141 @@ func (s *IntegrationTestSuite) TestNewSendTxCmd() { } } +// serviceMsgClientConn is an instance of grpc.ClientConn that is used to test building +// transactions with MsgClient's. It is intended to be replaced by the work in +// https://github.com/cosmos/cosmos-sdk/issues/7541 when that is ready. +type serviceMsgClientConn struct { + msgs []sdk.Msg +} + +func (t *serviceMsgClientConn) Invoke(_ context.Context, method string, args, _ interface{}, _ ...grpc2.CallOption) error { + req, ok := args.(sdk.MsgRequest) + if !ok { + return fmt.Errorf("%T should implement %T", args, (*sdk.MsgRequest)(nil)) + } + + err := req.ValidateBasic() + if err != nil { + return err + } + + t.msgs = append(t.msgs, sdk.ServiceMsg{ + MethodName: method, + Request: req, + }) + + return nil +} + +func (t *serviceMsgClientConn) NewStream(context.Context, *grpc2.StreamDesc, string, ...grpc2.CallOption) (grpc2.ClientStream, error) { + return nil, fmt.Errorf("not supported") +} + +var _ grpc.ClientConn = &serviceMsgClientConn{} + +// newSendTxMsgServiceCmd is just for the purpose of testing ServiceMsg's in an end-to-end case. It is effectively +// NewSendTxCmd but using MsgClient. +func newSendTxMsgServiceCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "send [from_key_or_address] [to_address] [amount]", + Short: `Send funds from one account to another. Note, the'--from' flag is +ignored as it is implied from [from_key_or_address].`, + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + cmd.Flags().Set(flags.FlagFrom, args[0]) + + clientCtx := client.GetClientContextFromCmd(cmd) + clientCtx, err := client.ReadTxCommandFlags(clientCtx, cmd.Flags()) + if err != nil { + return err + } + + toAddr, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + coins, err := sdk.ParseCoins(args[2]) + if err != nil { + return err + } + + msg := types.NewMsgSend(clientCtx.GetFromAddress(), toAddr, coins) + svcMsgClientConn := &serviceMsgClientConn{} + bankMsgClient := types.NewMsgClient(svcMsgClientConn) + _, err = bankMsgClient.Send(context.Background(), msg) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), svcMsgClientConn.msgs...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// TestBankMsgService does a basic test of whether or not service Msg's as defined +// in ADR 031 work in the most basic end-to-end case. +func (s *IntegrationTestSuite) TestBankMsgService() { + val := s.network.Validators[0] + + testCases := []struct { + name string + from, to sdk.AccAddress + amount sdk.Coins + args []string + expectErr bool + respType proto.Message + expectedCode uint32 + rawLogContains string + }{ + { + "valid transaction", + val.Address, + val.Address, + sdk.NewCoins( + sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), sdk.NewInt(10)), + sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10)), + ), + []string{ + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + }, + false, + &sdk.TxResponse{}, + 0, + "/cosmos.bank.v1beta1.Msg/Send", // indicates we are using ServiceMsg and not a regular Msg + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + clientCtx := val.ClientCtx + + args := []string{tc.from.String(), tc.to.String(), tc.amount.String()} + args = append(args, tc.args...) + + bz, err := clitestutil.ExecTestCLICmd(clientCtx, newSendTxMsgServiceCmd(), args) + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(bz.Bytes(), tc.respType), bz.String()) + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code) + s.Require().Contains(txResp.RawLog, tc.rawLogContains) + } + }) + } +} + func TestIntegrationTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/bank/module.go b/x/bank/module.go index 1b3d68f4607d..9712636133da 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -94,9 +94,9 @@ type AppModule struct { accountKeeper types.AccountKeeper } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/crisis/module.go b/x/crisis/module.go index fdc2ffb03d6f..4066cb2ef9d7 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -112,9 +112,10 @@ func (AppModule) QuerierRoute() string { return "" } // LegacyQuerierHandler returns no sdk.Querier. func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(module.Configurator) {} +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) +} // 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 9c53d5619170..c32bcbc1ed41 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -139,9 +139,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/evidence/module.go b/x/evidence/module.go index 1ac32c2148b7..7ff49aabd583 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -148,9 +148,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/gov/module.go b/x/gov/module.go index 31c0e5c05d80..1183f6060e72 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -155,9 +155,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/slashing/module.go b/x/slashing/module.go index f74c4a84dfd2..3698bb6987de 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -137,9 +137,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/staking/module.go b/x/staking/module.go index 6a344265b74a..4fa17d4d45d8 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -133,9 +133,9 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) querier := keeper.Querier{Keeper: am.keeper} types.RegisterQueryServer(cfg.QueryServer(), querier) } From a6f61d214a09986484a76e9921505c7a1f7b36cf Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Fri, 16 Oct 2020 18:05:25 +0200 Subject: [PATCH 10/12] Refactor x/evidence to ADR-031 (#7538) * Refactor x/evidence to ADR-031 * Add hash in response * Update changelog * Update x/evidence/keeper/keeper.go * Update proto/cosmos/evidence/v1beta1/tx.proto Co-authored-by: Marie Gauthier * Use msgServer struct Co-authored-by: Marie Gauthier --- CHANGELOG.md | 1 + proto/cosmos/evidence/v1beta1/tx.proto | 13 ++ x/bank/handler.go | 4 +- x/evidence/exported/evidence.go | 4 +- x/evidence/handler.go | 30 +-- x/evidence/handler_test.go | 9 +- x/evidence/keeper/msg_server.go | 42 ++++ x/evidence/types/msgs.go | 2 +- x/evidence/types/msgs_test.go | 2 +- x/evidence/types/tx.pb.go | 309 ++++++++++++++++++++++++- 10 files changed, 376 insertions(+), 40 deletions(-) create mode 100644 x/evidence/keeper/msg_server.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b1113fdc444..b8fd6b99e853 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * __Modules__ * (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`. + * (x/evidence) [\#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field of `MsgSubmitEvidence` does not contain the raw evidence's hash, but the encoded `MsgSubmitEvidenceResponse` struct. ### API Breaking diff --git a/proto/cosmos/evidence/v1beta1/tx.proto b/proto/cosmos/evidence/v1beta1/tx.proto index 352f7a1c23a7..38795f25d4e3 100644 --- a/proto/cosmos/evidence/v1beta1/tx.proto +++ b/proto/cosmos/evidence/v1beta1/tx.proto @@ -8,6 +8,13 @@ import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; import "cosmos_proto/cosmos.proto"; +// Msg defines the evidence Msg service. +service Msg { + // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); +} + // MsgSubmitEvidence represents a message that supports submitting arbitrary // Evidence of misbehavior such as equivocation or counterfactual signing. message MsgSubmitEvidence { @@ -17,3 +24,9 @@ message MsgSubmitEvidence { string submitter = 1; google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; } + +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +message MsgSubmitEvidenceResponse { + // hash defines the hash of the evidence. + bytes hash = 4; +} diff --git a/x/bank/handler.go b/x/bank/handler.go index d7c04897a5df..0fb0f53a4cd8 100644 --- a/x/bank/handler.go +++ b/x/bank/handler.go @@ -9,11 +9,11 @@ import ( // NewHandler returns a handler for "bank" type messages. func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + 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: res, err := msgServer.Send(sdk.WrapSDKContext(ctx), msg) diff --git a/x/evidence/exported/evidence.go b/x/evidence/exported/evidence.go index 0bba5fc487ab..1be263a8703b 100644 --- a/x/evidence/exported/evidence.go +++ b/x/evidence/exported/evidence.go @@ -34,10 +34,10 @@ type ValidatorEvidence interface { GetTotalPower() int64 } -// MsgSubmitEvidence defines the specific interface a concrete message must +// MsgSubmitEvidenceI defines the specific interface a concrete message must // implement in order to process submitted evidence. The concrete MsgSubmitEvidence // must be defined at the application-level. -type MsgSubmitEvidence interface { +type MsgSubmitEvidenceI interface { sdk.Msg GetEvidence() Evidence diff --git a/x/evidence/handler.go b/x/evidence/handler.go index 60c59158ede9..93da4d7bf50d 100644 --- a/x/evidence/handler.go +++ b/x/evidence/handler.go @@ -3,42 +3,24 @@ package evidence import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/evidence/exported" "github.com/cosmos/cosmos-sdk/x/evidence/keeper" "github.com/cosmos/cosmos-sdk/x/evidence/types" ) +// NewHandler returns a handler for evidence messages. func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { - case exported.MsgSubmitEvidence: - return handleMsgSubmitEvidence(ctx, k, msg) + case *types.MsgSubmitEvidence: + res, err := msgServer.SubmitEvidence(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized %s message type: %T", types.ModuleName, msg) } } } - -func handleMsgSubmitEvidence(ctx sdk.Context, k keeper.Keeper, msg exported.MsgSubmitEvidence) (*sdk.Result, error) { - evidence := msg.GetEvidence() - if err := k.SubmitEvidence(ctx, evidence); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - sdk.NewAttribute(sdk.AttributeKeySender, msg.GetSubmitter().String()), - ), - ) - - return &sdk.Result{ - Data: evidence.Hash(), - Events: ctx.EventManager().ABCIEvents(), - }, nil -} diff --git a/x/evidence/handler_test.go b/x/evidence/handler_test.go index 40114836883e..b3f95c300a4f 100644 --- a/x/evidence/handler_test.go +++ b/x/evidence/handler_test.go @@ -25,7 +25,7 @@ type HandlerTestSuite struct { app *simapp.SimApp } -func testMsgSubmitEvidence(r *require.Assertions, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidence { +func testMsgSubmitEvidence(r *require.Assertions, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidenceI { msg, err := types.NewMsgSubmitEvidence(s, e) r.NoError(err) return msg @@ -113,8 +113,11 @@ func (suite *HandlerTestSuite) TestMsgSubmitEvidence() { suite.Require().NoError(err, "unexpected error; tc #%d", i) suite.Require().NotNil(res, "expected non-nil result; tc #%d", i) - msg := tc.msg.(exported.MsgSubmitEvidence) - suite.Require().Equal(msg.GetEvidence().Hash().Bytes(), res.Data, "invalid hash; tc #%d", i) + msg := tc.msg.(exported.MsgSubmitEvidenceI) + + var resultData types.MsgSubmitEvidenceResponse + suite.app.AppCodec().UnmarshalBinaryBare(res.Data, &resultData) + suite.Require().Equal(msg.GetEvidence().Hash().Bytes(), resultData.Hash, "invalid hash; tc #%d", i) } } } diff --git a/x/evidence/keeper/msg_server.go b/x/evidence/keeper/msg_server.go new file mode 100644 index 000000000000..df3cabd4fe67 --- /dev/null +++ b/x/evidence/keeper/msg_server.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/evidence/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{} + +// SubmitEvidence implements the MsgServer.SubmitEvidence method. +func (ms msgServer) SubmitEvidence(goCtx context.Context, msg *types.MsgSubmitEvidence) (*types.MsgSubmitEvidenceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + evidence := msg.GetEvidence() + if err := ms.Keeper.SubmitEvidence(ctx, evidence); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(sdk.AttributeKeySender, msg.GetSubmitter().String()), + ), + ) + + return &types.MsgSubmitEvidenceResponse{ + Hash: evidence.Hash(), + }, nil +} diff --git a/x/evidence/types/msgs.go b/x/evidence/types/msgs.go index 74ffd0f500d8..cd2e2ba0321d 100644 --- a/x/evidence/types/msgs.go +++ b/x/evidence/types/msgs.go @@ -19,7 +19,7 @@ const ( var ( _ sdk.Msg = &MsgSubmitEvidence{} _ types.UnpackInterfacesMessage = MsgSubmitEvidence{} - _ exported.MsgSubmitEvidence = &MsgSubmitEvidence{} + _ exported.MsgSubmitEvidenceI = &MsgSubmitEvidence{} ) // NewMsgSubmitEvidence returns a new MsgSubmitEvidence with a signer/submitter. diff --git a/x/evidence/types/msgs_test.go b/x/evidence/types/msgs_test.go index 8bcf061ff3e3..4248b0dfba94 100644 --- a/x/evidence/types/msgs_test.go +++ b/x/evidence/types/msgs_test.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence/types" ) -func testMsgSubmitEvidence(t *testing.T, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidence { +func testMsgSubmitEvidence(t *testing.T, e exported.Evidence, s sdk.AccAddress) exported.MsgSubmitEvidenceI { msg, err := types.NewMsgSubmitEvidence(s, e) require.NoError(t, err) return msg diff --git a/x/evidence/types/tx.pb.go b/x/evidence/types/tx.pb.go index 876bf30e6416..5dc9c0fb6cf3 100644 --- a/x/evidence/types/tx.pb.go +++ b/x/evidence/types/tx.pb.go @@ -4,11 +4,17 @@ package types import ( + bytes "bytes" + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" _ "github.com/regen-network/cosmos-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,14 +71,61 @@ func (m *MsgSubmitEvidence) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSubmitEvidence proto.InternalMessageInfo +// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +type MsgSubmitEvidenceResponse struct { + // hash defines the hash of the evidence. + Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` +} + +func (m *MsgSubmitEvidenceResponse) Reset() { *m = MsgSubmitEvidenceResponse{} } +func (m *MsgSubmitEvidenceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitEvidenceResponse) ProtoMessage() {} +func (*MsgSubmitEvidenceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_3e3242cb23c956e0, []int{1} +} +func (m *MsgSubmitEvidenceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitEvidenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitEvidenceResponse.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 *MsgSubmitEvidenceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitEvidenceResponse.Merge(m, src) +} +func (m *MsgSubmitEvidenceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitEvidenceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitEvidenceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitEvidenceResponse proto.InternalMessageInfo + +func (m *MsgSubmitEvidenceResponse) GetHash() []byte { + if m != nil { + return m.Hash + } + return nil +} + func init() { proto.RegisterType((*MsgSubmitEvidence)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidence") + proto.RegisterType((*MsgSubmitEvidenceResponse)(nil), "cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse") } func init() { proto.RegisterFile("cosmos/evidence/v1beta1/tx.proto", fileDescriptor_3e3242cb23c956e0) } var fileDescriptor_3e3242cb23c956e0 = []byte{ - // 257 bytes of a gzipped FileDescriptorProto + // 316 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x4f, 0x2d, 0xcb, 0x4c, 0x49, 0xcd, 0x4b, 0x4e, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x87, 0xa8, @@ -84,12 +137,124 @@ var fileDescriptor_3e3242cb23c956e0 = []byte{ 0x10, 0x42, 0x40, 0xc8, 0x8e, 0x8b, 0x03, 0xe6, 0x24, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x11, 0x3d, 0x88, 0xdd, 0x7a, 0x30, 0xbb, 0xf5, 0x1c, 0xf3, 0x2a, 0x9d, 0x78, 0x4e, 0x6d, 0xd1, 0xe5, 0x80, 0x99, 0x19, 0x04, 0xd7, 0x63, 0xc5, 0xd1, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, - 0x06, 0x27, 0xef, 0x15, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, - 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, - 0x21, 0x4a, 0x37, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x17, 0xea, 0x66, 0x28, - 0xa5, 0x5b, 0x9c, 0x92, 0xad, 0x5f, 0x81, 0x08, 0xb9, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, - 0xb0, 0xe5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, 0x3b, 0xe2, 0x83, 0x59, 0x01, 0x00, - 0x00, + 0x06, 0x25, 0x7d, 0x2e, 0x49, 0x0c, 0xcb, 0x83, 0x52, 0x8b, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, + 0x84, 0xb8, 0x58, 0x32, 0x12, 0x8b, 0x33, 0x24, 0x58, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, + 0xa3, 0x72, 0x2e, 0x66, 0xdf, 0xe2, 0x74, 0xa1, 0x02, 0x2e, 0x3e, 0x34, 0x17, 0x6b, 0xe9, 0xe1, + 0x08, 0x2c, 0x3d, 0x0c, 0x0b, 0xa4, 0x8c, 0x88, 0x57, 0x0b, 0x73, 0x8c, 0x93, 0xf7, 0x8a, 0x47, + 0x72, 0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, + 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, 0x9e, 0x59, + 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0x0b, 0x0d, 0x5d, 0x28, 0xa5, 0x5b, 0x9c, 0x92, 0xad, + 0x5f, 0x81, 0x88, 0xe3, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x30, 0x19, 0x03, 0x02, + 0x00, 0x00, 0xff, 0xff, 0xa7, 0x78, 0xdf, 0xa8, 0x03, 0x02, 0x00, 0x00, +} + +func (this *MsgSubmitEvidenceResponse) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgSubmitEvidenceResponse) + if !ok { + that2, ok := that.(MsgSubmitEvidenceResponse) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !bytes.Equal(this.Hash, that1.Hash) { + return false + } + return true +} + +// 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 submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SubmitEvidence(ctx context.Context, in *MsgSubmitEvidence, opts ...grpc.CallOption) (*MsgSubmitEvidenceResponse, error) { + out := new(MsgSubmitEvidenceResponse) + err := c.cc.Invoke(ctx, "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Send submits an arbitrary Evidence of misbehavior such as equivocation or + // counterfactual signing. + SubmitEvidence(context.Context, *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SubmitEvidence(ctx context.Context, req *MsgSubmitEvidence) (*MsgSubmitEvidenceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitEvidence not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SubmitEvidence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitEvidence) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitEvidence(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.evidence.v1beta1.Msg/SubmitEvidence", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitEvidence(ctx, req.(*MsgSubmitEvidence)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.evidence.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SubmitEvidence", + Handler: _Msg_SubmitEvidence_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/evidence/v1beta1/tx.proto", } func (m *MsgSubmitEvidence) Marshal() (dAtA []byte, err error) { @@ -134,6 +299,36 @@ func (m *MsgSubmitEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgSubmitEvidenceResponse) 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 *MsgSubmitEvidenceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitEvidenceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Hash) > 0 { + i -= len(m.Hash) + copy(dAtA[i:], m.Hash) + i = encodeVarintTx(dAtA, i, uint64(len(m.Hash))) + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -162,6 +357,19 @@ func (m *MsgSubmitEvidence) Size() (n int) { return n } +func (m *MsgSubmitEvidenceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Hash) + 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 } @@ -289,6 +497,93 @@ func (m *MsgSubmitEvidence) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitEvidenceResponse) 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: MsgSubmitEvidenceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitEvidenceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hash", 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.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) + if m.Hash == nil { + m.Hash = []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 From 15b57677e84c55fec5b1d25e361574235b7c50e4 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Mon, 19 Oct 2020 23:51:53 +0530 Subject: [PATCH 11/12] Refactor x/ibc to ADR 031 (#7576) * WIP: Refactor x/ibc to ADR 031 * updated handler * removed unsued * fix * Add proto service for ibc/transfer * lint * remove old upgrade handler * added doc * review changes * fix tests * formatter * Add MsgServer wiring in RegisterServices Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .../applications/transfer/v1/transfer.proto | 9 + proto/ibc/core/channel/v1/channel.proto | 67 +- proto/ibc/core/client/v1/client.proto | 101 +- proto/ibc/core/connection/v1/connection.proto | 27 + x/ibc/applications/transfer/handler.go | 38 +- .../transfer/keeper/msg_server.go | 43 + x/ibc/applications/transfer/module.go | 4 +- .../transfer/types/transfer.pb.go | 296 ++- x/ibc/core/02-client/handler.go | 132 - x/ibc/core/02-client/handler_test.go | 220 -- x/ibc/core/02-client/proposal_handler.go | 22 + x/ibc/core/02-client/proposal_handler_test.go | 75 + x/ibc/core/02-client/types/client.pb.go | 2164 +++++++++++------ x/ibc/core/03-connection/handler.go | 135 - .../core/03-connection/types/connection.pb.go | 860 ++++++- x/ibc/core/04-channel/types/channel.pb.go | 1892 +++++++++++++- x/ibc/core/genesis_test.go | 38 + x/ibc/core/handler.go | 339 +-- x/ibc/core/keeper/msg_server.go | 622 +++++ .../msg_server_test.go} | 189 +- x/ibc/core/module.go | 5 +- 21 files changed, 5421 insertions(+), 1857 deletions(-) create mode 100644 x/ibc/applications/transfer/keeper/msg_server.go delete mode 100644 x/ibc/core/02-client/handler.go delete mode 100644 x/ibc/core/02-client/handler_test.go create mode 100644 x/ibc/core/02-client/proposal_handler.go create mode 100644 x/ibc/core/02-client/proposal_handler_test.go delete mode 100644 x/ibc/core/03-connection/handler.go create mode 100644 x/ibc/core/keeper/msg_server.go rename x/ibc/core/{handler_test.go => keeper/msg_server_test.go} (76%) diff --git a/proto/ibc/applications/transfer/v1/transfer.proto b/proto/ibc/applications/transfer/v1/transfer.proto index 28b7f9670451..1ebc884542dc 100644 --- a/proto/ibc/applications/transfer/v1/transfer.proto +++ b/proto/ibc/applications/transfer/v1/transfer.proto @@ -7,6 +7,12 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/transfer Msg service. +service Msg { + // Transfer defines a rpc handler method for MsgTransfer. + rpc Transfer(MsgTransfer) returns (MsgTransferResponse); +} + // MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between // ICS20 enabled chains. See ICS Spec here: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -33,6 +39,9 @@ message MsgTransfer { uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; } +// MsgTransferResponse defines the Msg/Transfer response type. +message MsgTransferResponse { } + // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 342f4d32e722..41414e8c2331 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -6,6 +6,39 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; import "gogoproto/gogo.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/channel Msg service. +service Msg { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); + + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); + + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); + + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); + + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); + + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + + // Timeout defines a rpc handler method for MsgTimeout. + rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); + + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); + + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); +} + // MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It // is called by a relayer on Chain A. message MsgChannelOpenInit { @@ -18,7 +51,10 @@ message MsgChannelOpenInit { string signer = 4; } -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +message MsgChannelOpenInitResponse {} + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. message MsgChannelOpenTry { option (gogoproto.equal) = false; @@ -35,6 +71,9 @@ message MsgChannelOpenTry { string signer = 8; } +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +message MsgChannelOpenTryResponse {} + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. message MsgChannelOpenAck { @@ -51,6 +90,9 @@ message MsgChannelOpenAck { string signer = 7; } +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +message MsgChannelOpenAckResponse {} + // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. message MsgChannelOpenConfirm { @@ -65,6 +107,9 @@ message MsgChannelOpenConfirm { string signer = 5; } +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +message MsgChannelOpenConfirmResponse {} + // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. message MsgChannelCloseInit { @@ -76,6 +121,9 @@ message MsgChannelCloseInit { string signer = 3; } +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +message MsgChannelCloseInitResponse {} + // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. message MsgChannelCloseConfirm { @@ -90,6 +138,9 @@ message MsgChannelCloseConfirm { string signer = 5; } +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +message MsgChannelCloseConfirmResponse {} + // MsgRecvPacket receives incoming IBC packet message MsgRecvPacket { option (gogoproto.equal) = false; @@ -102,6 +153,9 @@ message MsgRecvPacket { string signer = 4; } +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +message MsgRecvPacketResponse {} + // MsgTimeout receives timed-out packet message MsgTimeout { option (gogoproto.equal) = false; @@ -115,6 +169,9 @@ message MsgTimeout { string signer = 5; } +// MsgTimeoutResponse defines the Msg/Timeout response type. +message MsgTimeoutResponse {} + // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. message MsgTimeoutOnClose { option (gogoproto.equal) = false; @@ -129,6 +186,9 @@ message MsgTimeoutOnClose { string signer = 6; } +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +message MsgTimeoutOnCloseResponse {} + // MsgAcknowledgement receives incoming IBC acknowledgement message MsgAcknowledgement { option (gogoproto.equal) = false; @@ -142,6 +202,9 @@ message MsgAcknowledgement { string signer = 5; } +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +message MsgAcknowledgementResponse {} + // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -278,4 +341,4 @@ message Acknowledgement { bytes result = 21; string error = 22; } -} +} \ No newline at end of file diff --git a/proto/ibc/core/client/v1/client.proto b/proto/ibc/core/client/v1/client.proto index 4a6f8320e847..118318c246c8 100644 --- a/proto/ibc/core/client/v1/client.proto +++ b/proto/ibc/core/client/v1/client.proto @@ -6,46 +6,19 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; -// IdentifiedClientState defines a client state with an additional client -// identifier field. -message IdentifiedClientState { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} +// Msg defines the ibc/client Msg service. +service Msg { + // CreateClient defines a rpc handler method for MsgCreateClient. + rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); -// ConsensusStateWithHeight defines a consensus state with an additional height field. -message ConsensusStateWithHeight { - // consensus state height - Height height = 1 [(gogoproto.nullable) = false]; - // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; -} + // UpdateClient defines a rpc handler method for MsgUpdateClient. + rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); -// ClientConsensusStates defines all the stored consensus states for a given -// client. -message ClientConsensusStates { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; -} + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); -// ClientUpdateProposal is a governance proposal. If it passes, the client is -// updated with the provided header. The update may fail if the header is not -// valid given certain conditions specified by the client implementation. -message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; - // the title of the update proposal - string title = 1; - // the description of the proposal - string description = 2; - // the client identifier for the client to be updated if the proposal passes - string client_id = 3 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // the header used to update the client if the proposal passes - google.protobuf.Any header = 4; + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); } // MsgCreateClient defines a message to create an IBC client @@ -64,6 +37,9 @@ message MsgCreateClient { string signer = 4; } +// MsgCreateClientResponse defines the Msg/CreateClient response type. +message MsgCreateClientResponse { } + // MsgUpdateClient defines an sdk.Msg to update a IBC client state using // the given header. message MsgUpdateClient { @@ -78,6 +54,9 @@ message MsgUpdateClient { string signer = 3; } +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +message MsgUpdateClientResponse { } + // MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state message MsgUpgradeClient { // client unique identifier @@ -92,6 +71,9 @@ message MsgUpgradeClient { string signer = 5; } +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +message MsgUpgradeClientResponse { } + // MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for // light client misbehaviour. message MsgSubmitMisbehaviour { @@ -106,6 +88,51 @@ message MsgSubmitMisbehaviour { string signer = 3; } +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +message MsgSubmitMisbehaviourResponse { } + +// IdentifiedClientState defines a client state with an additional client +// identifier field. +message IdentifiedClientState { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // client state + google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; +} + +// ConsensusStateWithHeight defines a consensus state with an additional height field. +message ConsensusStateWithHeight { + // consensus state height + Height height = 1 [(gogoproto.nullable) = false]; + // consensus state + google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml\"consensus_state\""]; +} + +// ClientConsensusStates defines all the stored consensus states for a given +// client. +message ClientConsensusStates { + // client identifier + string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // consensus states and their heights associated with the client + repeated ConsensusStateWithHeight consensus_states = 2 + [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; +} + +// ClientUpdateProposal is a governance proposal. If it passes, the client is +// updated with the provided header. The update may fail if the header is not +// valid given certain conditions specified by the client implementation. +message ClientUpdateProposal { + option (gogoproto.goproto_getters) = false; + // the title of the update proposal + string title = 1; + // the description of the proposal + string description = 2; + // the client identifier for the client to be updated if the proposal passes + string client_id = 3 [(gogoproto.moretags) = "yaml:\"client_id\""]; + // the header used to update the client if the proposal passes + google.protobuf.Any header = 4; +} + // Height is a monotonically increasing data type // that can be compared against another Height for the purposes of updating and // freezing clients diff --git a/proto/ibc/core/connection/v1/connection.proto b/proto/ibc/core/connection/v1/connection.proto index 368859d3b93c..5b0dd2fe5d41 100644 --- a/proto/ibc/core/connection/v1/connection.proto +++ b/proto/ibc/core/connection/v1/connection.proto @@ -8,6 +8,21 @@ import "google/protobuf/any.proto"; import "ibc/core/commitment/v1/commitment.proto"; import "ibc/core/client/v1/client.proto"; +// Msg defines the ibc/connection Msg service. +service Msg { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); + + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); + + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); + + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); +} + // MsgConnectionOpenInit defines the msg sent by an account on Chain A to // initialize a connection with Chain B. message MsgConnectionOpenInit { @@ -21,6 +36,9 @@ message MsgConnectionOpenInit { string signer = 5; } +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +message MsgConnectionOpenInitResponse { } + // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. message MsgConnectionOpenTry { @@ -47,6 +65,9 @@ message MsgConnectionOpenTry { string signer = 12; } +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +message MsgConnectionOpenTryResponse { } + // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. message MsgConnectionOpenAck { @@ -71,6 +92,9 @@ message MsgConnectionOpenAck { string signer = 10; } +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +message MsgConnectionOpenAckResponse { } + // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. message MsgConnectionOpenConfirm { @@ -85,6 +109,9 @@ message MsgConnectionOpenConfirm { string signer = 4; } +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +message MsgConnectionOpenConfirmResponse { } + // ICS03 - Connection Data Structures as defined in // https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics#data-structures diff --git a/x/ibc/applications/transfer/handler.go b/x/ibc/applications/transfer/handler.go index 81d9d62d8600..7c992c920e72 100644 --- a/x/ibc/applications/transfer/handler.go +++ b/x/ibc/applications/transfer/handler.go @@ -3,51 +3,21 @@ package transfer import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/keeper" "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" ) // NewHandler returns sdk.Handler for IBC token transfer module messages -func NewHandler(k keeper.Keeper) sdk.Handler { +func NewHandler(k types.MsgServer) sdk.Handler { return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { ctx = ctx.WithEventManager(sdk.NewEventManager()) switch msg := msg.(type) { case *types.MsgTransfer: - return handleMsgTransfer(ctx, k, msg) + res, err := k.Transfer(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ICS-20 transfer message type: %T", msg) } } } - -// See createOutgoingPacket in spec:https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#packet-relay -func handleMsgTransfer(ctx sdk.Context, k keeper.Keeper, msg *types.MsgTransfer) (*sdk.Result, error) { - sender, err := sdk.AccAddressFromBech32(msg.Sender) - if err != nil { - return nil, err - } - if err := k.SendTransfer( - ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, - ); err != nil { - return nil, err - } - - k.Logger(ctx).Info("IBC fungible token transfer", "token", msg.Token.Denom, "amount", msg.Token.Amount.String(), "sender", msg.Sender, "receiver", msg.Receiver) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeTransfer, - sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), - sdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} diff --git a/x/ibc/applications/transfer/keeper/msg_server.go b/x/ibc/applications/transfer/keeper/msg_server.go new file mode 100644 index 000000000000..dd2999af341e --- /dev/null +++ b/x/ibc/applications/transfer/keeper/msg_server.go @@ -0,0 +1,43 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" +) + +var _ types.MsgServer = Keeper{} + +// See createOutgoingPacket in spec:https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#packet-relay + +// Transfer defines a rpc handler method for MsgTransfer. +func (k Keeper) Transfer(goCtx context.Context, msg *types.MsgTransfer) (*types.MsgTransferResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + sender, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, err + } + if err := k.SendTransfer( + ctx, msg.SourcePort, msg.SourceChannel, msg.Token, sender, msg.Receiver, msg.TimeoutHeight, msg.TimeoutTimestamp, + ); err != nil { + return nil, err + } + + k.Logger(ctx).Info("IBC fungible token transfer", "token", msg.Token.Denom, "amount", msg.Token.Amount.String(), "sender", msg.Sender, "receiver", msg.Receiver) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeTransfer, + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + sdk.NewAttribute(types.AttributeKeyReceiver, msg.Receiver), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + ), + }) + + return &types.MsgTransferResponse{}, nil +} diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 4d73f693cd2a..99478288095d 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -120,9 +120,9 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the -// module-specific GRPC queries. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) } diff --git a/x/ibc/applications/transfer/types/transfer.pb.go b/x/ibc/applications/transfer/types/transfer.pb.go index 281b1fc9f6fa..db4e10f45c58 100644 --- a/x/ibc/applications/transfer/types/transfer.pb.go +++ b/x/ibc/applications/transfer/types/transfer.pb.go @@ -4,11 +4,16 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + grpc1 "github.com/gogo/protobuf/grpc" types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" _ "github.com/gogo/protobuf/gogoproto" 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" @@ -80,6 +85,43 @@ func (m *MsgTransfer) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTransfer proto.InternalMessageInfo +// MsgTransferResponse defines the Msg/Transfer response type. +type MsgTransferResponse struct { +} + +func (m *MsgTransferResponse) Reset() { *m = MsgTransferResponse{} } +func (m *MsgTransferResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferResponse) ProtoMessage() {} +func (*MsgTransferResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5041673e96e97901, []int{1} +} +func (m *MsgTransferResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferResponse.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 *MsgTransferResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferResponse.Merge(m, src) +} +func (m *MsgTransferResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferResponse proto.InternalMessageInfo + // FungibleTokenPacketData defines a struct for the packet payload // See FungibleTokenPacketData spec: // https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures @@ -98,7 +140,7 @@ func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketData) ProtoMessage() {} func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{1} + return fileDescriptor_5041673e96e97901, []int{2} } func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -169,7 +211,7 @@ func (m *DenomTrace) Reset() { *m = DenomTrace{} } func (m *DenomTrace) String() string { return proto.CompactTextString(m) } func (*DenomTrace) ProtoMessage() {} func (*DenomTrace) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{2} + return fileDescriptor_5041673e96e97901, []int{3} } func (m *DenomTrace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -229,7 +271,7 @@ func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_5041673e96e97901, []int{3} + return fileDescriptor_5041673e96e97901, []int{4} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -274,6 +316,7 @@ func (m *Params) GetReceiveEnabled() bool { func init() { proto.RegisterType((*MsgTransfer)(nil), "ibc.applications.transfer.v1.MsgTransfer") + proto.RegisterType((*MsgTransferResponse)(nil), "ibc.applications.transfer.v1.MsgTransferResponse") proto.RegisterType((*FungibleTokenPacketData)(nil), "ibc.applications.transfer.v1.FungibleTokenPacketData") proto.RegisterType((*DenomTrace)(nil), "ibc.applications.transfer.v1.DenomTrace") proto.RegisterType((*Params)(nil), "ibc.applications.transfer.v1.Params") @@ -284,45 +327,129 @@ func init() { } var fileDescriptor_5041673e96e97901 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0xdb, 0x34, 0x5f, 0x3b, 0xf9, 0x5a, 0x60, 0x28, 0xad, 0x1b, 0xb5, 0x76, 0xe5, 0x55, - 0x25, 0x84, 0xad, 0x80, 0x10, 0x52, 0x17, 0x80, 0xd2, 0x82, 0x60, 0x81, 0x54, 0x59, 0x59, 0x20, - 0x36, 0x61, 0x3c, 0x19, 0x9c, 0x51, 0xed, 0x19, 0x6b, 0x66, 0x12, 0x51, 0xf1, 0x02, 0xb0, 0xe3, - 0x11, 0xba, 0xe6, 0x49, 0xba, 0xec, 0x92, 0x95, 0x85, 0xda, 0x0d, 0xeb, 0x3c, 0x01, 0x9a, 0x9f, - 0x86, 0x04, 0xa9, 0x2b, 0xcf, 0xb9, 0xf7, 0x9c, 0x7b, 0xe6, 0xde, 0xeb, 0x01, 0x0f, 0x69, 0x86, - 0x13, 0x54, 0x55, 0x05, 0xc5, 0x48, 0x51, 0xce, 0x64, 0xa2, 0x04, 0x62, 0xf2, 0x13, 0x11, 0xc9, - 0xa4, 0x3b, 0x3b, 0xc7, 0x95, 0xe0, 0x8a, 0xc3, 0x5d, 0x9a, 0xe1, 0x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 0x90, 0xa1, 0xa9, 0xb2, 0xda, 0xdb, 0x9e, 0xd6, - 0xe1, 0x7d, 0xf7, 0xab, 0xcc, 0x65, 0xa3, 0xb4, 0xad, 0xe1, 0x2b, 0x8b, 0xe0, 0x11, 0xb8, 0xe3, - 0xee, 0x34, 0x93, 0x2f, 0x19, 0x79, 0x67, 0x5a, 0x87, 0x5b, 0x56, 0xfe, 0x0f, 0x21, 0x4a, 0x37, - 0x5c, 0xc4, 0x15, 0xe9, 0xbd, 0xbf, 0xb8, 0x0a, 0xbc, 0xcb, 0xab, 0xc0, 0xfb, 0x75, 0x15, 0x78, - 0xdf, 0xaf, 0x83, 0xc6, 0xe5, 0x75, 0xd0, 0xf8, 0x79, 0x1d, 0x34, 0x3e, 0x3c, 0xcf, 0xa9, 0x1a, - 0x8d, 0xb3, 0x18, 0xf3, 0x32, 0x71, 0x8f, 0xcb, 0x7e, 0x1e, 0xc9, 0xe1, 0x69, 0xf2, 0x39, 0xb9, - 0xfd, 0x45, 0xab, 0xb3, 0x8a, 0xc8, 0xac, 0x65, 0xde, 0xd5, 0x93, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xed, 0xa5, 0xb5, 0x3a, 0xfb, 0x03, 0x00, 0x00, + // 638 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x9b, 0x34, 0xa4, 0x1b, 0x5a, 0x60, 0xfb, 0xe7, 0x46, 0xad, 0x5d, 0xf9, 0x54, 0x84, + 0x58, 0x2b, 0x45, 0x08, 0xa9, 0x07, 0x40, 0x69, 0x41, 0x70, 0xa8, 0x54, 0x59, 0x39, 0x20, 0x2e, + 0x61, 0xbd, 0x59, 0x1c, 0xab, 0xf1, 0xae, 0xe5, 0xdd, 0x44, 0x54, 0xbc, 0x00, 0xdc, 0x78, 0x84, + 0x9e, 0x79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, 0x2c, 0xf2, 0x2c, 0xa7, 0x22, 0xae, 0xeb, 0xfd, 0x7e, + 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x34, 0x4e, 0x38, 0x40, 0x83, 0x04, 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 { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) Transfer(ctx context.Context, in *MsgTransfer, opts ...grpc.CallOption) (*MsgTransferResponse, error) { + out := new(MsgTransferResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.transfer.v1.Msg/Transfer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Transfer defines a rpc handler method for MsgTransfer. + Transfer(context.Context, *MsgTransfer) (*MsgTransferResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) Transfer(ctx context.Context, req *MsgTransfer) (*MsgTransferResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Transfer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_Transfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransfer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Transfer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.transfer.v1.Msg/Transfer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Transfer(ctx, req.(*MsgTransfer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.transfer.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Transfer", + Handler: _Msg_Transfer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/transfer/v1/transfer.proto", } func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { @@ -401,6 +528,29 @@ func (m *MsgTransfer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTransferResponse) 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 *MsgTransferResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *FungibleTokenPacketData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -573,6 +723,15 @@ func (m *MsgTransfer) Size() (n int) { return n } +func (m *MsgTransferResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *FungibleTokenPacketData) Size() (n int) { if m == nil { return 0 @@ -901,6 +1060,59 @@ func (m *MsgTransfer) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTransferResponse) 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 ErrIntOverflowTransfer + } + 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: MsgTransferResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTransfer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthTransfer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *FungibleTokenPacketData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/02-client/handler.go b/x/ibc/core/02-client/handler.go deleted file mode 100644 index 55cf0862f84e..000000000000 --- a/x/ibc/core/02-client/handler.go +++ /dev/null @@ -1,132 +0,0 @@ -package client - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/keeper" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" -) - -// HandleMsgCreateClient defines the sdk.Handler for MsgCreateClient -func HandleMsgCreateClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgCreateClient) (*sdk.Result, error) { - clientState, err := types.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - - consensusState, err := types.UnpackConsensusState(msg.ConsensusState) - if err != nil { - return nil, err - } - - if err = k.CreateClient(ctx, msg.ClientId, clientState, consensusState); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeCreateClient, - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, clientState.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgUpdateClient defines the sdk.Handler for MsgUpdateClient -func HandleMsgUpdateClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpdateClient) (*sdk.Result, error) { - header, err := types.UnpackHeader(msg.Header) - if err != nil { - return nil, err - } - - if err = k.UpdateClient(ctx, msg.ClientId, header); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgUpgradeClient defines the sdk.Handler for MsgUpgradeClient -func HandleMsgUpgradeClient(ctx sdk.Context, k keeper.Keeper, msg *types.MsgUpgradeClient) (*sdk.Result, error) { - upgradedClient, err := types.UnpackClientState(msg.ClientState) - if err != nil { - return nil, err - } - - if err := upgradedClient.Validate(); err != nil { - return nil, err - } - - if err = k.UpgradeClient(ctx, msg.ClientId, upgradedClient, msg.UpgradeHeight, msg.ProofUpgrade); err != nil { - return nil, err - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgSubmitMisbehaviour defines the Evidence module handler for submitting a -// light client misbehaviour. -func HandleMsgSubmitMisbehaviour(ctx sdk.Context, k keeper.Keeper, msg *types.MsgSubmitMisbehaviour) (*sdk.Result, error) { - misbehaviour, err := types.UnpackMisbehaviour(msg.Misbehaviour) - if err != nil { - return nil, err - } - - if err := k.CheckMisbehaviourAndUpdateState(ctx, misbehaviour); err != nil { - return nil, sdkerrors.Wrap(err, "failed to process misbehaviour for IBC client") - } - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeSubmitMisbehaviour, - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyClientType, misbehaviour.ClientType()), - sdk.NewAttribute(types.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), - ), - ) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// NewClientUpdateProposalHandler defines the client update proposal handler -func NewClientUpdateProposalHandler(k keeper.Keeper) govtypes.Handler { - return func(ctx sdk.Context, content govtypes.Content) error { - switch c := content.(type) { - case *types.ClientUpdateProposal: - return k.ClientUpdateProposal(ctx, c) - - default: - return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ibc proposal content type: %T", c) - } - } -} diff --git a/x/ibc/core/02-client/handler_test.go b/x/ibc/core/02-client/handler_test.go deleted file mode 100644 index 7aa7d5e7b8ca..000000000000 --- a/x/ibc/core/02-client/handler_test.go +++ /dev/null @@ -1,220 +0,0 @@ -package client_test - -import ( - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" - distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" - "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" - ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" - ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" -) - -func (suite *ClientTestSuite) TestNewClientUpdateProposalHandler() { - var ( - content govtypes.Content - err error - ) - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "valid update client proposal", func() { - clientA, _ := suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) - clientState := suite.chainA.GetClientState(clientA) - - tmClientState, ok := clientState.(*ibctmtypes.ClientState) - suite.Require().True(ok) - tmClientState.AllowUpdateAfterMisbehaviour = true - tmClientState.FrozenHeight = tmClientState.LatestHeight - suite.chainA.App.IBCKeeper.ClientKeeper.SetClientState(suite.chainA.GetContext(), clientA, tmClientState) - - // use next header for chainB to update the client on chainA - header, err := suite.chainA.ConstructUpdateTMClientHeader(suite.chainB, clientA) - suite.Require().NoError(err) - - content, err = clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, clientA, header) - suite.Require().NoError(err) - }, true, - }, - { - "nil proposal", func() { - content = nil - }, false, - }, - { - "unsupported proposal type", func() { - content = distributiontypes.NewCommunityPoolSpendProposal(ibctesting.Title, ibctesting.Description, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(sdk.NewCoin("communityfunds", sdk.NewInt(10)))) - }, false, - }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() // reset - - tc.malleate() - - proposalHandler := client.NewClientUpdateProposalHandler(suite.chainA.App.IBCKeeper.ClientKeeper) - - err = proposalHandler(suite.chainA.GetContext(), content) - - if tc.expPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - }) - } - -} - -func (suite *ClientTestSuite) TestUpgradeClient() { - var ( - clientA string - upgradedClient exported.ClientState - upgradeHeight exported.Height - msg *clienttypes.MsgUpgradeClient - ) - - newClientHeight := clienttypes.NewHeight(1, 1) - - cases := []struct { - name string - setup func() - expPass bool - }{ - { - name: "successful upgrade", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: true, - }, - { - name: "invalid upgrade: msg.ClientState does not contain valid clientstate", - setup: func() { - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - consState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("app_hash")), []byte("next_vals_hash")) - consAny, err := clienttypes.PackConsensusState(consState) - suite.Require().NoError(err) - - height, _ := upgradeHeight.(types.Height) - - msg = &types.MsgUpgradeClient{ClientId: clientA, ClientState: consAny, UpgradeHeight: &height, ProofUpgrade: proofUpgrade, Signer: suite.chainA.SenderAccount.GetAddress().String()} - }, - expPass: false, - }, - { - name: "invalid clientstate", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(found) - - proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: false, - }, - { - name: "VerifyUpgrade fails", - setup: func() { - - upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) - - // upgrade Height is at next block - upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) - - // zero custom fields and store in upgrade store - suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) - - // commit upgrade store changes and update clients - - suite.coordinator.CommitBlock(suite.chainB) - err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) - suite.Require().NoError(err) - - msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, nil, suite.chainA.SenderAccount.GetAddress()) - suite.Require().NoError(err) - }, - expPass: false, - }, - } - - for _, tc := range cases { - tc := tc - clientA, _ = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) - - tc.setup() - - _, err := client.HandleMsgUpgradeClient( - suite.chainA.GetContext(), suite.chainA.App.IBCKeeper.ClientKeeper, msg, - ) - - if tc.expPass { - suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) - newClient, ok := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) - suite.Require().True(ok) - suite.Require().Equal(upgradedClient, newClient) - } else { - suite.Require().Error(err, "upgrade handler passed on invalid case: %s", tc.name) - } - } -} diff --git a/x/ibc/core/02-client/proposal_handler.go b/x/ibc/core/02-client/proposal_handler.go new file mode 100644 index 000000000000..befa95df642f --- /dev/null +++ b/x/ibc/core/02-client/proposal_handler.go @@ -0,0 +1,22 @@ +package client + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/keeper" + "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" +) + +// NewClientUpdateProposalHandler defines the client update proposal handler +func NewClientUpdateProposalHandler(k keeper.Keeper) govtypes.Handler { + return func(ctx sdk.Context, content govtypes.Content) error { + switch c := content.(type) { + case *types.ClientUpdateProposal: + return k.ClientUpdateProposal(ctx, c) + + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized ibc proposal content type: %T", c) + } + } +} diff --git a/x/ibc/core/02-client/proposal_handler_test.go b/x/ibc/core/02-client/proposal_handler_test.go new file mode 100644 index 000000000000..839dd2e532ab --- /dev/null +++ b/x/ibc/core/02-client/proposal_handler_test.go @@ -0,0 +1,75 @@ +package client_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" + ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" +) + +func (suite *ClientTestSuite) TestNewClientUpdateProposalHandler() { + var ( + content govtypes.Content + err error + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "valid update client proposal", func() { + clientA, _ := suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) + clientState := suite.chainA.GetClientState(clientA) + + tmClientState, ok := clientState.(*ibctmtypes.ClientState) + suite.Require().True(ok) + tmClientState.AllowUpdateAfterMisbehaviour = true + tmClientState.FrozenHeight = tmClientState.LatestHeight + suite.chainA.App.IBCKeeper.ClientKeeper.SetClientState(suite.chainA.GetContext(), clientA, tmClientState) + + // use next header for chainB to update the client on chainA + header, err := suite.chainA.ConstructUpdateTMClientHeader(suite.chainB, clientA) + suite.Require().NoError(err) + + content, err = clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, clientA, header) + suite.Require().NoError(err) + }, true, + }, + { + "nil proposal", func() { + content = nil + }, false, + }, + { + "unsupported proposal type", func() { + content = distributiontypes.NewCommunityPoolSpendProposal(ibctesting.Title, ibctesting.Description, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(sdk.NewCoin("communityfunds", sdk.NewInt(10)))) + }, false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + tc.malleate() + + proposalHandler := client.NewClientUpdateProposalHandler(suite.chainA.App.IBCKeeper.ClientKeeper) + + err = proposalHandler(suite.chainA.GetContext(), content) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } + +} diff --git a/x/ibc/core/02-client/types/client.pb.go b/x/ibc/core/02-client/types/client.pb.go index f70ceca58c94..601a1d7686e1 100644 --- a/x/ibc/core/02-client/types/client.pb.go +++ b/x/ibc/core/02-client/types/client.pb.go @@ -4,10 +4,15 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" _ "github.com/gogo/protobuf/gogoproto" 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" @@ -24,6 +29,370 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgCreateClient defines a message to create an IBC client +type MsgCreateClient struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // light client state + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + // consensus state associated with the client that corresponds to a given + // height. + ConsensusState *types.Any `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` + // signer address + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgCreateClient) Reset() { *m = MsgCreateClient{} } +func (m *MsgCreateClient) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClient) ProtoMessage() {} +func (*MsgCreateClient) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{0} +} +func (m *MsgCreateClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClient.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 *MsgCreateClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClient.Merge(m, src) +} +func (m *MsgCreateClient) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClient proto.InternalMessageInfo + +// MsgCreateClientResponse defines the Msg/CreateClient response type. +type MsgCreateClientResponse struct { +} + +func (m *MsgCreateClientResponse) Reset() { *m = MsgCreateClientResponse{} } +func (m *MsgCreateClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateClientResponse) ProtoMessage() {} +func (*MsgCreateClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{1} +} +func (m *MsgCreateClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateClientResponse.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 *MsgCreateClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateClientResponse.Merge(m, src) +} +func (m *MsgCreateClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateClientResponse proto.InternalMessageInfo + +// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +// the given header. +type MsgUpdateClient struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // header to update the light client + Header *types.Any `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` + // signer address + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgUpdateClient) Reset() { *m = MsgUpdateClient{} } +func (m *MsgUpdateClient) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateClient) ProtoMessage() {} +func (*MsgUpdateClient) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{2} +} +func (m *MsgUpdateClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateClient.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 *MsgUpdateClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateClient.Merge(m, src) +} +func (m *MsgUpdateClient) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateClient proto.InternalMessageInfo + +// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +type MsgUpdateClientResponse struct { +} + +func (m *MsgUpdateClientResponse) Reset() { *m = MsgUpdateClientResponse{} } +func (m *MsgUpdateClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateClientResponse) ProtoMessage() {} +func (*MsgUpdateClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{3} +} +func (m *MsgUpdateClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateClientResponse.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 *MsgUpdateClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateClientResponse.Merge(m, src) +} +func (m *MsgUpdateClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateClientResponse proto.InternalMessageInfo + +// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state +type MsgUpgradeClient struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // upgraded client state + ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` + // height at which old chain halts and upgrades (i.e last block executed) + UpgradeHeight *Height `protobuf:"bytes,3,opt,name=upgrade_height,json=upgradeHeight,proto3" json:"upgrade_height,omitempty" yaml:"upgrade_height"` + // proof that old chain committed to new client + ProofUpgrade []byte `protobuf:"bytes,4,opt,name=proof_upgrade,json=proofUpgrade,proto3" json:"proof_upgrade,omitempty" yaml:"proof_upgrade"` + // signer address + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgUpgradeClient) Reset() { *m = MsgUpgradeClient{} } +func (m *MsgUpgradeClient) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeClient) ProtoMessage() {} +func (*MsgUpgradeClient) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{4} +} +func (m *MsgUpgradeClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeClient.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 *MsgUpgradeClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeClient.Merge(m, src) +} +func (m *MsgUpgradeClient) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeClient proto.InternalMessageInfo + +func (m *MsgUpgradeClient) GetClientId() string { + if m != nil { + return m.ClientId + } + return "" +} + +func (m *MsgUpgradeClient) GetClientState() *types.Any { + if m != nil { + return m.ClientState + } + return nil +} + +func (m *MsgUpgradeClient) GetUpgradeHeight() *Height { + if m != nil { + return m.UpgradeHeight + } + return nil +} + +func (m *MsgUpgradeClient) GetProofUpgrade() []byte { + if m != nil { + return m.ProofUpgrade + } + return nil +} + +func (m *MsgUpgradeClient) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +type MsgUpgradeClientResponse struct { +} + +func (m *MsgUpgradeClientResponse) Reset() { *m = MsgUpgradeClientResponse{} } +func (m *MsgUpgradeClientResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpgradeClientResponse) ProtoMessage() {} +func (*MsgUpgradeClientResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{5} +} +func (m *MsgUpgradeClientResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpgradeClientResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpgradeClientResponse.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 *MsgUpgradeClientResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpgradeClientResponse.Merge(m, src) +} +func (m *MsgUpgradeClientResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpgradeClientResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpgradeClientResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpgradeClientResponse proto.InternalMessageInfo + +// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +// light client misbehaviour. +type MsgSubmitMisbehaviour struct { + // client unique identifier + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` + // misbehaviour used for freezing the light client + Misbehaviour *types.Any `protobuf:"bytes,2,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` + // signer address + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgSubmitMisbehaviour) Reset() { *m = MsgSubmitMisbehaviour{} } +func (m *MsgSubmitMisbehaviour) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMisbehaviour) ProtoMessage() {} +func (*MsgSubmitMisbehaviour) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{6} +} +func (m *MsgSubmitMisbehaviour) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMisbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMisbehaviour.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 *MsgSubmitMisbehaviour) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMisbehaviour.Merge(m, src) +} +func (m *MsgSubmitMisbehaviour) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMisbehaviour) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMisbehaviour.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMisbehaviour proto.InternalMessageInfo + +// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +type MsgSubmitMisbehaviourResponse struct { +} + +func (m *MsgSubmitMisbehaviourResponse) Reset() { *m = MsgSubmitMisbehaviourResponse{} } +func (m *MsgSubmitMisbehaviourResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMisbehaviourResponse) ProtoMessage() {} +func (*MsgSubmitMisbehaviourResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{7} +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMisbehaviourResponse.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 *MsgSubmitMisbehaviourResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMisbehaviourResponse.Merge(m, src) +} +func (m *MsgSubmitMisbehaviourResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMisbehaviourResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMisbehaviourResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMisbehaviourResponse proto.InternalMessageInfo + // IdentifiedClientState defines a client state with an additional client // identifier field. type IdentifiedClientState struct { @@ -37,7 +406,7 @@ func (m *IdentifiedClientState) Reset() { *m = IdentifiedClientState{} } func (m *IdentifiedClientState) String() string { return proto.CompactTextString(m) } func (*IdentifiedClientState) ProtoMessage() {} func (*IdentifiedClientState) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{0} + return fileDescriptor_b6bc4c8185546947, []int{8} } func (m *IdentifiedClientState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -92,7 +461,7 @@ func (m *ConsensusStateWithHeight) Reset() { *m = ConsensusStateWithHeig func (m *ConsensusStateWithHeight) String() string { return proto.CompactTextString(m) } func (*ConsensusStateWithHeight) ProtoMessage() {} func (*ConsensusStateWithHeight) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{1} + return fileDescriptor_b6bc4c8185546947, []int{9} } func (m *ConsensusStateWithHeight) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -148,7 +517,7 @@ func (m *ClientConsensusStates) Reset() { *m = ClientConsensusStates{} } func (m *ClientConsensusStates) String() string { return proto.CompactTextString(m) } func (*ClientConsensusStates) ProtoMessage() {} func (*ClientConsensusStates) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{2} + return fileDescriptor_b6bc4c8185546947, []int{10} } func (m *ClientConsensusStates) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +578,7 @@ func (m *ClientUpdateProposal) Reset() { *m = ClientUpdateProposal{} } func (m *ClientUpdateProposal) String() string { return proto.CompactTextString(m) } func (*ClientUpdateProposal) ProtoMessage() {} func (*ClientUpdateProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{3} + return fileDescriptor_b6bc4c8185546947, []int{11} } func (m *ClientUpdateProposal) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,31 +607,33 @@ func (m *ClientUpdateProposal) XXX_DiscardUnknown() { var xxx_messageInfo_ClientUpdateProposal proto.InternalMessageInfo -// MsgCreateClient defines a message to create an IBC client -type MsgCreateClient struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // light client state - ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` - // consensus state associated with the client that corresponds to a given - // height. - ConsensusState *types.Any `protobuf:"bytes,3,opt,name=consensus_state,json=consensusState,proto3" json:"consensus_state,omitempty" yaml:"consensus_state"` - // signer address - Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` +// Height is a monotonically increasing data type +// that can be compared against another Height for the purposes of updating and +// freezing clients +// +// Normally the VersionHeight is incremented at each height while keeping version +// number the same However some consensus algorithms may choose to reset the +// height in certain conditions e.g. hard forks, state-machine breaking changes +// In these cases, the version number is incremented so that height continues to +// be monitonically increasing even as the VersionHeight gets reset +type Height struct { + // the version that the client is currently on + VersionNumber uint64 `protobuf:"varint,1,opt,name=version_number,json=versionNumber,proto3" json:"version_number,omitempty" yaml:"version_number"` + // the height within the given version + VersionHeight uint64 `protobuf:"varint,2,opt,name=version_height,json=versionHeight,proto3" json:"version_height,omitempty" yaml:"version_height"` } -func (m *MsgCreateClient) Reset() { *m = MsgCreateClient{} } -func (m *MsgCreateClient) String() string { return proto.CompactTextString(m) } -func (*MsgCreateClient) ProtoMessage() {} -func (*MsgCreateClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{4} +func (m *Height) Reset() { *m = Height{} } +func (*Height) ProtoMessage() {} +func (*Height) Descriptor() ([]byte, []int) { + return fileDescriptor_b6bc4c8185546947, []int{12} } -func (m *MsgCreateClient) XXX_Unmarshal(b []byte) error { +func (m *Height) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateClient.Marshal(b, m, deterministic) + return xxx_messageInfo_Height.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -272,300 +643,289 @@ func (m *MsgCreateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *MsgCreateClient) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateClient.Merge(m, src) +func (m *Height) XXX_Merge(src proto.Message) { + xxx_messageInfo_Height.Merge(m, src) } -func (m *MsgCreateClient) XXX_Size() int { +func (m *Height) XXX_Size() int { return m.Size() } -func (m *MsgCreateClient) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateClient.DiscardUnknown(m) +func (m *Height) XXX_DiscardUnknown() { + xxx_messageInfo_Height.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateClient proto.InternalMessageInfo - -// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given header. -type MsgUpdateClient struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // header to update the light client - Header *types.Any `protobuf:"bytes,2,opt,name=header,proto3" json:"header,omitempty"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` -} +var xxx_messageInfo_Height proto.InternalMessageInfo -func (m *MsgUpdateClient) Reset() { *m = MsgUpdateClient{} } -func (m *MsgUpdateClient) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateClient) ProtoMessage() {} -func (*MsgUpdateClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{5} -} -func (m *MsgUpdateClient) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateClient.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 *MsgUpdateClient) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateClient.Merge(m, src) -} -func (m *MsgUpdateClient) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateClient) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateClient.DiscardUnknown(m) +func init() { + proto.RegisterType((*MsgCreateClient)(nil), "ibc.core.client.v1.MsgCreateClient") + proto.RegisterType((*MsgCreateClientResponse)(nil), "ibc.core.client.v1.MsgCreateClientResponse") + proto.RegisterType((*MsgUpdateClient)(nil), "ibc.core.client.v1.MsgUpdateClient") + proto.RegisterType((*MsgUpdateClientResponse)(nil), "ibc.core.client.v1.MsgUpdateClientResponse") + proto.RegisterType((*MsgUpgradeClient)(nil), "ibc.core.client.v1.MsgUpgradeClient") + proto.RegisterType((*MsgUpgradeClientResponse)(nil), "ibc.core.client.v1.MsgUpgradeClientResponse") + proto.RegisterType((*MsgSubmitMisbehaviour)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviour") + proto.RegisterType((*MsgSubmitMisbehaviourResponse)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviourResponse") + proto.RegisterType((*IdentifiedClientState)(nil), "ibc.core.client.v1.IdentifiedClientState") + proto.RegisterType((*ConsensusStateWithHeight)(nil), "ibc.core.client.v1.ConsensusStateWithHeight") + proto.RegisterType((*ClientConsensusStates)(nil), "ibc.core.client.v1.ClientConsensusStates") + proto.RegisterType((*ClientUpdateProposal)(nil), "ibc.core.client.v1.ClientUpdateProposal") + proto.RegisterType((*Height)(nil), "ibc.core.client.v1.Height") } -var xxx_messageInfo_MsgUpdateClient proto.InternalMessageInfo +func init() { proto.RegisterFile("ibc/core/client/v1/client.proto", fileDescriptor_b6bc4c8185546947) } -// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state -type MsgUpgradeClient struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // upgraded client state - ClientState *types.Any `protobuf:"bytes,2,opt,name=client_state,json=clientState,proto3" json:"client_state,omitempty" yaml:"client_state"` - // height at which old chain halts and upgrades (i.e last block executed) - UpgradeHeight *Height `protobuf:"bytes,3,opt,name=upgrade_height,json=upgradeHeight,proto3" json:"upgrade_height,omitempty" yaml:"upgrade_height"` - // proof that old chain committed to new client - ProofUpgrade []byte `protobuf:"bytes,4,opt,name=proof_upgrade,json=proofUpgrade,proto3" json:"proof_upgrade,omitempty" yaml:"proof_upgrade"` - // signer address - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` +var fileDescriptor_b6bc4c8185546947 = []byte{ + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x3f, 0x6f, 0x1a, 0x49, + 0x14, 0x67, 0x01, 0x23, 0x7b, 0x00, 0xdb, 0xda, 0x03, 0x1b, 0xaf, 0x74, 0x2c, 0x9a, 0xbb, 0xc2, + 0xa7, 0xb3, 0x77, 0x0f, 0xae, 0x38, 0xcb, 0xd2, 0x49, 0x77, 0xd0, 0x9c, 0x0b, 0x4e, 0xbe, 0xb5, + 0x4e, 0xf9, 0xa3, 0x48, 0x64, 0xff, 0x8c, 0x97, 0x51, 0x60, 0x07, 0xed, 0x2c, 0xc8, 0x7c, 0x83, + 0x94, 0x91, 0x12, 0x45, 0x29, 0x52, 0x58, 0x29, 0x52, 0xa6, 0xcb, 0x37, 0x48, 0xe1, 0x22, 0x85, + 0xcb, 0x54, 0x28, 0xb2, 0x9b, 0xd4, 0x7c, 0x82, 0x68, 0x77, 0xc6, 0xab, 0x5d, 0x0c, 0x98, 0x38, + 0x8d, 0x2b, 0xf6, 0xbd, 0xf9, 0xcd, 0xef, 0xbd, 0xf7, 0x9b, 0x37, 0x6f, 0x00, 0x32, 0x36, 0x4c, + 0xd5, 0x24, 0x2e, 0x52, 0xcd, 0x0e, 0x46, 0x8e, 0xa7,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, 0x08, 0x47, 0x13, 0x77, 0xb0, 0x1c, 0xd8, 0x45, + 0x7c, 0x75, 0x2a, 0x27, 0x6a, 0x6f, 0x52, 0x20, 0xd5, 0xa4, 0xb6, 0xf8, 0x18, 0xe4, 0x62, 0x6f, + 0xf0, 0x4f, 0xd3, 0x0e, 0x72, 0xe2, 0x4d, 0x92, 0x7e, 0x5d, 0x00, 0x74, 0x75, 0xa3, 0xfd, 0x08, + 0xb1, 0x47, 0x6b, 0x56, 0x84, 0x28, 0x68, 0x66, 0x84, 0x69, 0x0f, 0x8d, 0x68, 0x82, 0x7c, 0xfc, + 0x91, 0xf9, 0x79, 0xe6, 0xee, 0x08, 0x4a, 0xda, 0x59, 0x04, 0x15, 0x06, 0x71, 0x81, 0x38, 0x65, + 0xbc, 0xfe, 0x32, 0x83, 0xe3, 0x3a, 0x54, 0xaa, 0x2e, 0x0c, 0xbd, 0x8a, 0x59, 0xff, 0xef, 0xec, + 0xa2, 0x2c, 0x9c, 0x5f, 0x94, 0x85, 0xcf, 0x17, 0x65, 0xe1, 0xd9, 0x65, 0x39, 0x71, 0x7e, 0x59, + 0x4e, 0x7c, 0xba, 0x2c, 0x27, 0x1e, 0xfe, 0x61, 0x63, 0xaf, 0xdd, 0x37, 0x14, 0x93, 0x74, 0x55, + 0x93, 0xd0, 0x2e, 0xa1, 0xfc, 0x67, 0x97, 0x5a, 0x4f, 0xd4, 0x13, 0x35, 0xfc, 0x0f, 0xf7, 0x5b, + 0x6d, 0x97, 0xff, 0x8d, 0xf3, 0x86, 0x3d, 0x44, 0x8d, 0x4c, 0xd0, 0xac, 0xbf, 0x7f, 0x0d, 0x00, + 0x00, 0xff, 0xff, 0x06, 0xa7, 0xa2, 0x16, 0xe6, 0x09, 0x00, 0x00, } -func (m *MsgUpgradeClient) Reset() { *m = MsgUpgradeClient{} } -func (m *MsgUpgradeClient) String() string { return proto.CompactTextString(m) } -func (*MsgUpgradeClient) ProtoMessage() {} -func (*MsgUpgradeClient) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{6} -} -func (m *MsgUpgradeClient) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpgradeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpgradeClient.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 *MsgUpgradeClient) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpgradeClient.Merge(m, src) -} -func (m *MsgUpgradeClient) XXX_Size() int { - return m.Size() -} -func (m *MsgUpgradeClient) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpgradeClient.DiscardUnknown(m) -} +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn -var xxx_messageInfo_MsgUpgradeClient proto.InternalMessageInfo +// 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 -func (m *MsgUpgradeClient) GetClientId() string { - if m != nil { - return m.ClientId - } - return "" +// 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 { + // CreateClient defines a rpc handler method for MsgCreateClient. + CreateClient(ctx context.Context, in *MsgCreateClient, opts ...grpc.CallOption) (*MsgCreateClientResponse, error) + // UpdateClient defines a rpc handler method for MsgUpdateClient. + UpdateClient(ctx context.Context, in *MsgUpdateClient, opts ...grpc.CallOption) (*MsgUpdateClientResponse, error) + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + UpgradeClient(ctx context.Context, in *MsgUpgradeClient, opts ...grpc.CallOption) (*MsgUpgradeClientResponse, error) + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + SubmitMisbehaviour(ctx context.Context, in *MsgSubmitMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitMisbehaviourResponse, error) } -func (m *MsgUpgradeClient) GetClientState() *types.Any { - if m != nil { - return m.ClientState - } - return nil +type msgClient struct { + cc grpc1.ClientConn } -func (m *MsgUpgradeClient) GetUpgradeHeight() *Height { - if m != nil { - return m.UpgradeHeight - } - return nil +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} } -func (m *MsgUpgradeClient) GetProofUpgrade() []byte { - if m != nil { - return m.ProofUpgrade +func (c *msgClient) CreateClient(ctx context.Context, in *MsgCreateClient, opts ...grpc.CallOption) (*MsgCreateClientResponse, error) { + out := new(MsgCreateClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/CreateClient", in, out, opts...) + if err != nil { + return nil, err } - return nil + return out, nil } -func (m *MsgUpgradeClient) GetSigner() string { - if m != nil { - return m.Signer +func (c *msgClient) UpdateClient(ctx context.Context, in *MsgUpdateClient, opts ...grpc.CallOption) (*MsgUpdateClientResponse, error) { + out := new(MsgUpdateClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/UpdateClient", in, out, opts...) + if err != nil { + return nil, err } - return "" + return out, nil } -// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -// light client misbehaviour. -type MsgSubmitMisbehaviour struct { - // client unique identifier - ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" yaml:"client_id"` - // misbehaviour used for freezing the light client - Misbehaviour *types.Any `protobuf:"bytes,2,opt,name=misbehaviour,proto3" json:"misbehaviour,omitempty"` - // signer address - Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +func (c *msgClient) UpgradeClient(ctx context.Context, in *MsgUpgradeClient, opts ...grpc.CallOption) (*MsgUpgradeClientResponse, error) { + out := new(MsgUpgradeClientResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/UpgradeClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (m *MsgSubmitMisbehaviour) Reset() { *m = MsgSubmitMisbehaviour{} } -func (m *MsgSubmitMisbehaviour) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitMisbehaviour) ProtoMessage() {} -func (*MsgSubmitMisbehaviour) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{7} -} -func (m *MsgSubmitMisbehaviour) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitMisbehaviour) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitMisbehaviour.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 (c *msgClient) SubmitMisbehaviour(ctx context.Context, in *MsgSubmitMisbehaviour, opts ...grpc.CallOption) (*MsgSubmitMisbehaviourResponse, error) { + out := new(MsgSubmitMisbehaviourResponse) + err := c.cc.Invoke(ctx, "/ibc.core.client.v1.Msg/SubmitMisbehaviour", in, out, opts...) + if err != nil { + return nil, err } -} -func (m *MsgSubmitMisbehaviour) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitMisbehaviour.Merge(m, src) -} -func (m *MsgSubmitMisbehaviour) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitMisbehaviour) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitMisbehaviour.DiscardUnknown(m) + return out, nil } -var xxx_messageInfo_MsgSubmitMisbehaviour proto.InternalMessageInfo - -// Height is a monotonically increasing data type -// that can be compared against another Height for the purposes of updating and -// freezing clients -// -// Normally the VersionHeight is incremented at each height while keeping version -// number the same However some consensus algorithms may choose to reset the -// height in certain conditions e.g. hard forks, state-machine breaking changes -// In these cases, the version number is incremented so that height continues to -// be monitonically increasing even as the VersionHeight gets reset -type Height struct { - // the version that the client is currently on - VersionNumber uint64 `protobuf:"varint,1,opt,name=version_number,json=versionNumber,proto3" json:"version_number,omitempty" yaml:"version_number"` - // the height within the given version - VersionHeight uint64 `protobuf:"varint,2,opt,name=version_height,json=versionHeight,proto3" json:"version_height,omitempty" yaml:"version_height"` +// MsgServer is the server API for Msg service. +type MsgServer interface { + // CreateClient defines a rpc handler method for MsgCreateClient. + CreateClient(context.Context, *MsgCreateClient) (*MsgCreateClientResponse, error) + // UpdateClient defines a rpc handler method for MsgUpdateClient. + UpdateClient(context.Context, *MsgUpdateClient) (*MsgUpdateClientResponse, error) + // UpgradeClient defines a rpc handler method for MsgUpgradeClient. + UpgradeClient(context.Context, *MsgUpgradeClient) (*MsgUpgradeClientResponse, error) + // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + SubmitMisbehaviour(context.Context, *MsgSubmitMisbehaviour) (*MsgSubmitMisbehaviourResponse, error) } -func (m *Height) Reset() { *m = Height{} } -func (*Height) ProtoMessage() {} -func (*Height) Descriptor() ([]byte, []int) { - return fileDescriptor_b6bc4c8185546947, []int{8} +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { } -func (m *Height) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) + +func (*UnimplementedMsgServer) CreateClient(ctx context.Context, req *MsgCreateClient) (*MsgCreateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateClient not implemented") } -func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Height.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 (*UnimplementedMsgServer) UpdateClient(ctx context.Context, req *MsgUpdateClient) (*MsgUpdateClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateClient not implemented") } -func (m *Height) XXX_Merge(src proto.Message) { - xxx_messageInfo_Height.Merge(m, src) +func (*UnimplementedMsgServer) UpgradeClient(ctx context.Context, req *MsgUpgradeClient) (*MsgUpgradeClientResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpgradeClient not implemented") } -func (m *Height) XXX_Size() int { - return m.Size() +func (*UnimplementedMsgServer) SubmitMisbehaviour(ctx context.Context, req *MsgSubmitMisbehaviour) (*MsgSubmitMisbehaviourResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitMisbehaviour not implemented") } -func (m *Height) XXX_DiscardUnknown() { - xxx_messageInfo_Height.DiscardUnknown(m) + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) } -var xxx_messageInfo_Height proto.InternalMessageInfo +func _Msg_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/CreateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateClient(ctx, req.(*MsgCreateClient)) + } + return interceptor(ctx, in, info, handler) +} -func init() { - proto.RegisterType((*IdentifiedClientState)(nil), "ibc.core.client.v1.IdentifiedClientState") - proto.RegisterType((*ConsensusStateWithHeight)(nil), "ibc.core.client.v1.ConsensusStateWithHeight") - proto.RegisterType((*ClientConsensusStates)(nil), "ibc.core.client.v1.ClientConsensusStates") - proto.RegisterType((*ClientUpdateProposal)(nil), "ibc.core.client.v1.ClientUpdateProposal") - proto.RegisterType((*MsgCreateClient)(nil), "ibc.core.client.v1.MsgCreateClient") - proto.RegisterType((*MsgUpdateClient)(nil), "ibc.core.client.v1.MsgUpdateClient") - proto.RegisterType((*MsgUpgradeClient)(nil), "ibc.core.client.v1.MsgUpgradeClient") - proto.RegisterType((*MsgSubmitMisbehaviour)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviour") - proto.RegisterType((*Height)(nil), "ibc.core.client.v1.Height") +func _Msg_UpdateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/UpdateClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateClient(ctx, req.(*MsgUpdateClient)) + } + return interceptor(ctx, in, info, handler) } -func init() { proto.RegisterFile("ibc/core/client/v1/client.proto", fileDescriptor_b6bc4c8185546947) } +func _Msg_UpgradeClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpgradeClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpgradeClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/UpgradeClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpgradeClient(ctx, req.(*MsgUpgradeClient)) + } + return interceptor(ctx, in, info, handler) +} -var fileDescriptor_b6bc4c8185546947 = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x3d, 0x4f, 0xdb, 0x4e, - 0x1c, 0x8e, 0x93, 0x10, 0x91, 0x4b, 0x78, 0x91, 0xff, 0x09, 0x84, 0x0c, 0x71, 0x74, 0x13, 0x03, - 0xd8, 0x7f, 0xd2, 0xa1, 0x28, 0x52, 0xa5, 0x36, 0x2c, 0x65, 0xa0, 0xa2, 0x46, 0x55, 0x5f, 0x54, - 0x29, 0xf2, 0xcb, 0xe1, 0x9c, 0x9a, 0xf8, 0x22, 0xdf, 0x25, 0x22, 0xdf, 0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f, 0xd0, - 0xb3, 0x51, 0xc0, 0xe9, 0x65, 0xe3, 0x62, 0x26, 0xeb, 0xd0, 0x9c, 0x93, 0x89, 0x67, 0x3c, 0x8e, - 0x23, 0x48, 0xab, 0xd2, 0xd3, 0x10, 0x26, 0x76, 0xc8, 0x84, 0xe0, 0x20, 0x88, 0x7d, 0x39, 0xd4, - 0x52, 0xad, 0xe7, 0x47, 0x27, 0x35, 0xe5, 0xf8, 0xa4, 0xa6, 0xfc, 0x39, 0xa9, 0x29, 0x1f, 0x4e, - 0x6b, 0xa9, 0xe3, 0xd3, 0x5a, 0xea, 0xf7, 0x69, 0x2d, 0xf5, 0xe6, 0xa1, 0x87, 0x59, 0x67, 0x60, - 0xeb, 0x0e, 0xe9, 0x19, 0x0e, 0xa1, 0x3d, 0x42, 0xe5, 0x67, 0x9d, 0xba, 0xef, 0x8c, 0x03, 0x63, - 0xf2, 0xaf, 0xfe, 0xbf, 0xb1, 0x2e, 0x7f, 0xd7, 0x6c, 0xd4, 0x47, 0xd4, 0xce, 0x71, 0xa5, 0x1e, - 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x1c, 0xf5, 0xf4, 0xce, 0x07, 0x00, 0x00, +func _Msg_SubmitMisbehaviour_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitMisbehaviour) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitMisbehaviour(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.client.v1.Msg/SubmitMisbehaviour", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitMisbehaviour(ctx, req.(*MsgSubmitMisbehaviour)) + } + return interceptor(ctx, in, info, handler) } -func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.client.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateClient", + Handler: _Msg_CreateClient_Handler, + }, + { + MethodName: "UpdateClient", + Handler: _Msg_UpdateClient_Handler, + }, + { + MethodName: "UpgradeClient", + Handler: _Msg_UpgradeClient_Handler, + }, + { + MethodName: "SubmitMisbehaviour", + Handler: _Msg_SubmitMisbehaviour_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/client/v1/client.proto", +} + +func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -575,16 +935,35 @@ func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IdentifiedClientState) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateClient) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if m.ConsensusState != nil { + { + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if m.ClientState != nil { { size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) @@ -607,7 +986,7 @@ func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error) { +func (m *MsgCreateClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -617,19 +996,49 @@ func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgCreateClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgCreateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.ConsensusState != nil { + return len(dAtA) - i, nil +} + +func (m *MsgUpdateClient) 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 *MsgUpdateClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if m.Header != nil { { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -639,20 +1048,17 @@ func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error i-- dAtA[i] = 0x12 } - { - size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) + if len(m.ClientId) > 0 { + i -= len(m.ClientId) + copy(dAtA[i:], m.ClientId) + i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ClientConsensusStates) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -662,29 +1068,76 @@ func (m *ClientConsensusStates) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ClientConsensusStates) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ConsensusStates) > 0 { - for iNdEx := len(m.ConsensusStates) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ConsensusStates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) + return len(dAtA) - i, nil +} + +func (m *MsgUpgradeClient) 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 *MsgUpgradeClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x2a + } + if len(m.ProofUpgrade) > 0 { + i -= len(m.ProofUpgrade) + copy(dAtA[i:], m.ProofUpgrade) + i = encodeVarintClient(dAtA, i, uint64(len(m.ProofUpgrade))) + i-- + dAtA[i] = 0x22 + } + if m.UpgradeHeight != nil { + { + size, err := m.UpgradeHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x12 + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ClientState != nil { + { + size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } if len(m.ClientId) > 0 { i -= len(m.ClientId) @@ -696,7 +1149,7 @@ func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ClientUpdateProposal) Marshal() (dAtA []byte, err error) { +func (m *MsgUpgradeClientResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -706,19 +1159,49 @@ func (m *ClientUpdateProposal) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ClientUpdateProposal) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpgradeClientResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpgradeClientResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Header != nil { + return len(dAtA) - i, nil +} + +func (m *MsgSubmitMisbehaviour) 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 *MsgSubmitMisbehaviour) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if m.Misbehaviour != nil { { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -726,33 +1209,42 @@ func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintClient(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x12 } if len(m.ClientId) > 0 { i -= len(m.ClientId) copy(dAtA[i:], m.ClientId) i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) i-- - dAtA[i] = 0x1a - } - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintClient(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if len(m.Title) > 0 { - i -= len(m.Title) - copy(dAtA[i:], m.Title) - i = encodeVarintClient(dAtA, i, uint64(len(m.Title))) - i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { +func (m *MsgSubmitMisbehaviourResponse) 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 *MsgSubmitMisbehaviourResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMisbehaviourResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *IdentifiedClientState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -762,35 +1254,16 @@ func (m *MsgCreateClient) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateClient) MarshalTo(dAtA []byte) (int, error) { +func (m *IdentifiedClientState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IdentifiedClientState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x22 - } - if m.ConsensusState != nil { - { - size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } if m.ClientState != nil { { size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) @@ -813,7 +1286,7 @@ func (m *MsgCreateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateClient) Marshal() (dAtA []byte, err error) { +func (m *ConsensusStateWithHeight) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -823,26 +1296,19 @@ func (m *MsgUpdateClient) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateClient) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsensusStateWithHeight) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsensusStateWithHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if m.Header != nil { + if m.ConsensusState != nil { { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ConsensusState.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -852,17 +1318,20 @@ func (m *MsgUpdateClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.ClientId) > 0 { - i -= len(m.ClientId) - copy(dAtA[i:], m.ClientId) - i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) - i-- - dAtA[i] = 0xa + { + size, err := m.Height.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *MsgUpgradeClient) Marshal() (dAtA []byte, err error) { +func (m *ClientConsensusStates) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -872,53 +1341,29 @@ func (m *MsgUpgradeClient) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpgradeClient) MarshalTo(dAtA []byte) (int, error) { +func (m *ClientConsensusStates) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClientConsensusStates) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x2a - } - if len(m.ProofUpgrade) > 0 { - i -= len(m.ProofUpgrade) - copy(dAtA[i:], m.ProofUpgrade) - i = encodeVarintClient(dAtA, i, uint64(len(m.ProofUpgrade))) - i-- - dAtA[i] = 0x22 - } - if m.UpgradeHeight != nil { - { - size, err := m.UpgradeHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ClientState != nil { - { - size, err := m.ClientState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.ConsensusStates) > 0 { + for iNdEx := len(m.ConsensusStates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConsensusStates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintClient(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintClient(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - i-- - dAtA[i] = 0x12 } if len(m.ClientId) > 0 { i -= len(m.ClientId) @@ -930,7 +1375,7 @@ func (m *MsgUpgradeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgSubmitMisbehaviour) Marshal() (dAtA []byte, err error) { +func (m *ClientUpdateProposal) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -940,26 +1385,19 @@ func (m *MsgSubmitMisbehaviour) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgSubmitMisbehaviour) MarshalTo(dAtA []byte) (int, error) { +func (m *ClientUpdateProposal) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ClientUpdateProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signer) > 0 { - i -= len(m.Signer) - copy(dAtA[i:], m.Signer) - i = encodeVarintClient(dAtA, i, uint64(len(m.Signer))) - i-- - dAtA[i] = 0x1a - } - if m.Misbehaviour != nil { + if m.Header != nil { { - size, err := m.Misbehaviour.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -967,13 +1405,27 @@ func (m *MsgSubmitMisbehaviour) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintClient(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x22 } if len(m.ClientId) > 0 { i -= len(m.ClientId) copy(dAtA[i:], m.ClientId) i = encodeVarintClient(dAtA, i, uint64(len(m.ClientId))) i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintClient(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintClient(dAtA, i, uint64(len(m.Title))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -1023,7 +1475,7 @@ func encodeVarintClient(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *IdentifiedClientState) Size() (n int) { +func (m *MsgCreateClient) Size() (n int) { if m == nil { return 0 } @@ -1037,25 +1489,27 @@ func (m *IdentifiedClientState) Size() (n int) { l = m.ClientState.Size() n += 1 + l + sovClient(uint64(l)) } + if m.ConsensusState != nil { + l = m.ConsensusState.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) + } return n } -func (m *ConsensusStateWithHeight) Size() (n int) { +func (m *MsgCreateClientResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Height.Size() - n += 1 + l + sovClient(uint64(l)) - if m.ConsensusState != nil { - l = m.ConsensusState.Size() - n += 1 + l + sovClient(uint64(l)) - } return n } -func (m *ClientConsensusStates) Size() (n int) { +func (m *MsgUpdateClient) Size() (n int) { if m == nil { return 0 } @@ -1065,41 +1519,65 @@ func (m *ClientConsensusStates) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if len(m.ConsensusStates) > 0 { - for _, e := range m.ConsensusStates { - l = e.Size() - n += 1 + l + sovClient(uint64(l)) - } + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovClient(uint64(l)) } return n } -func (m *ClientUpdateProposal) Size() (n int) { +func (m *MsgUpdateClientResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Title) + return n +} + +func (m *MsgUpgradeClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientId) if l > 0 { n += 1 + l + sovClient(uint64(l)) } - l = len(m.Description) - if l > 0 { + if m.ClientState != nil { + l = m.ClientState.Size() n += 1 + l + sovClient(uint64(l)) } - l = len(m.ClientId) + if m.UpgradeHeight != nil { + l = m.UpgradeHeight.Size() + n += 1 + l + sovClient(uint64(l)) + } + l = len(m.ProofUpgrade) if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.Header != nil { - l = m.Header.Size() + l = len(m.Signer) + if l > 0 { n += 1 + l + sovClient(uint64(l)) } return n } -func (m *MsgCreateClient) Size() (n int) { +func (m *MsgUpgradeClientResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSubmitMisbehaviour) Size() (n int) { if m == nil { return 0 } @@ -1109,12 +1587,8 @@ func (m *MsgCreateClient) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovClient(uint64(l)) - } - if m.ConsensusState != nil { - l = m.ConsensusState.Size() + if m.Misbehaviour != nil { + l = m.Misbehaviour.Size() n += 1 + l + sovClient(uint64(l)) } l = len(m.Signer) @@ -1124,7 +1598,16 @@ func (m *MsgCreateClient) Size() (n int) { return n } -func (m *MsgUpdateClient) Size() (n int) { +func (m *MsgSubmitMisbehaviourResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *IdentifiedClientState) Size() (n int) { if m == nil { return 0 } @@ -1134,18 +1617,29 @@ func (m *MsgUpdateClient) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.Header != nil { - l = m.Header.Size() + if m.ClientState != nil { + l = m.ClientState.Size() n += 1 + l + sovClient(uint64(l)) } - l = len(m.Signer) - if l > 0 { + return n +} + +func (m *ConsensusStateWithHeight) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Height.Size() + n += 1 + l + sovClient(uint64(l)) + if m.ConsensusState != nil { + l = m.ConsensusState.Size() n += 1 + l + sovClient(uint64(l)) } return n } -func (m *MsgUpgradeClient) Size() (n int) { +func (m *ClientConsensusStates) Size() (n int) { if m == nil { return 0 } @@ -1155,43 +1649,37 @@ func (m *MsgUpgradeClient) Size() (n int) { if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.ClientState != nil { - l = m.ClientState.Size() - n += 1 + l + sovClient(uint64(l)) - } - if m.UpgradeHeight != nil { - l = m.UpgradeHeight.Size() - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.ProofUpgrade) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) - } - l = len(m.Signer) - if l > 0 { - n += 1 + l + sovClient(uint64(l)) + if len(m.ConsensusStates) > 0 { + for _, e := range m.ConsensusStates { + l = e.Size() + n += 1 + l + sovClient(uint64(l)) + } } return n } -func (m *MsgSubmitMisbehaviour) Size() (n int) { +func (m *ClientUpdateProposal) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.ClientId) + l = len(m.Title) if l > 0 { n += 1 + l + sovClient(uint64(l)) } - if m.Misbehaviour != nil { - l = m.Misbehaviour.Size() + l = len(m.Description) + if l > 0 { n += 1 + l + sovClient(uint64(l)) } - l = len(m.Signer) + l = len(m.ClientId) if l > 0 { n += 1 + l + sovClient(uint64(l)) } + if m.Header != nil { + l = m.Header.Size() + n += 1 + l + sovClient(uint64(l)) + } return n } @@ -1216,7 +1704,7 @@ func sovClient(x uint64) (n int) { func sozClient(x uint64) (n int) { return sovClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { +func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1239,10 +1727,10 @@ func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IdentifiedClientState: wiretype end group for non-group") + return fmt.Errorf("proto: MsgCreateClient: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IdentifiedClientState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1313,62 +1801,9 @@ func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipClient(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthClient - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ConsensusStateWithHeight) 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 ErrIntOverflowClient - } - 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: ConsensusStateWithHeight: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusStateWithHeight: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1395,15 +1830,18 @@ func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Height.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} + } + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1413,28 +1851,77 @@ func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - if m.ConsensusState == nil { - m.ConsensusState = &types.Any{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateClientResponse) 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 ErrIntOverflowClient + } + 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: MsgCreateClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipClient(dAtA[iNdEx:]) @@ -1459,7 +1946,7 @@ func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1482,10 +1969,10 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClientConsensusStates: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateClient: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClientConsensusStates: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1522,7 +2009,7 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusStates", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1549,11 +2036,98 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsensusStates = append(m.ConsensusStates, ConsensusStateWithHeight{}) - if err := m.ConsensusStates[len(m.ConsensusStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Header == nil { + m.Header = &types.Any{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateClientResponse) 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 ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - iNdEx = postIndex + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateClientResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipClient(dAtA[iNdEx:]) @@ -1578,7 +2152,7 @@ func (m *ClientConsensusStates) Unmarshal(dAtA []byte) error { } return nil } -func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { +func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1601,15 +2175,15 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ClientUpdateProposal: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpgradeClient: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ClientUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1637,13 +2211,13 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Title = string(dAtA[iNdEx:postIndex]) + m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1653,29 +2227,33 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.Description = string(dAtA[iNdEx:postIndex]) + if m.ClientState == nil { + m.ClientState = &types.Any{} + } + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UpgradeHeight", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1685,29 +2263,33 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + if m.UpgradeHeight == nil { + m.UpgradeHeight = &Height{} + } + if err := m.UpgradeHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ProofUpgrade", wireType) } - var msglen int + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -1717,27 +2299,57 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + if byteLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &types.Any{} + m.ProofUpgrade = append(m.ProofUpgrade[:0], dAtA[iNdEx:postIndex]...) + if m.ProofUpgrade == nil { + m.ProofUpgrade = []byte{} } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + 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 ErrInvalidLengthClient } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1763,7 +2375,7 @@ func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { +func (m *MsgUpgradeClientResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1786,10 +2398,63 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateClient: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpgradeClientResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateClient: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpgradeClientResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitMisbehaviour) 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 ErrIntOverflowClient + } + 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: MsgSubmitMisbehaviour: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1826,7 +2491,7 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1853,50 +2518,14 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClientState == nil { - m.ClientState = &types.Any{} + if m.Misbehaviour == nil { + m.Misbehaviour = &types.Any{} } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthClient - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsensusState == nil { - m.ConsensusState = &types.Any{} - } - if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } @@ -1952,7 +2581,60 @@ func (m *MsgCreateClient) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { +func (m *MsgSubmitMisbehaviourResponse) 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 ErrIntOverflowClient + } + 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: MsgSubmitMisbehaviourResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMisbehaviourResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IdentifiedClientState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1975,10 +2657,10 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateClient: wiretype end group for non-group") + return fmt.Errorf("proto: IdentifiedClientState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateClient: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IdentifiedClientState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2015,7 +2697,7 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2042,45 +2724,13 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Header == nil { - m.Header = &types.Any{} + if m.ClientState == nil { + m.ClientState = &types.Any{} } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - 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 ErrInvalidLengthClient - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthClient - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipClient(dAtA[iNdEx:]) @@ -2105,7 +2755,7 @@ func (m *MsgUpdateClient) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { +func (m *ConsensusStateWithHeight) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2128,17 +2778,17 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpgradeClient: wiretype end group for non-group") + return fmt.Errorf("proto: ConsensusStateWithHeight: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpgradeClient: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsensusStateWithHeight: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2148,27 +2798,28 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + if err := m.Height.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientState", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusState", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2195,54 +2846,71 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClientState == nil { - m.ClientState = &types.Any{} + if m.ConsensusState == nil { + m.ConsensusState = &types.Any{} } - if err := m.ClientState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ConsensusState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UpgradeHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowClient - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipClient(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthClient } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.UpgradeHeight == nil { - m.UpgradeHeight = &Height{} + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientConsensusStates) 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 ErrIntOverflowClient } - if err := m.UpgradeHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex - case 4: + 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: ClientConsensusStates: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientConsensusStates: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProofUpgrade", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2252,31 +2920,29 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.ProofUpgrade = append(m.ProofUpgrade[:0], dAtA[iNdEx:postIndex]...) - if m.ProofUpgrade == nil { - m.ProofUpgrade = []byte{} - } + m.ClientId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusStates", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2286,23 +2952,25 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ConsensusStates = append(m.ConsensusStates, ConsensusStateWithHeight{}) + if err := m.ConsensusStates[len(m.ConsensusStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -2328,7 +2996,7 @@ func (m *MsgUpgradeClient) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { +func (m *ClientUpdateProposal) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2351,15 +3019,15 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitMisbehaviour: wiretype end group for non-group") + return fmt.Errorf("proto: ClientUpdateProposal: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitMisbehaviour: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ClientUpdateProposal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2387,13 +3055,13 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ClientId = string(dAtA[iNdEx:postIndex]) + m.Title = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Misbehaviour", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowClient @@ -2403,31 +3071,27 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthClient } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthClient } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Misbehaviour == nil { - m.Misbehaviour = &types.Any{} - } - if err := m.Misbehaviour.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Description = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClientId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2455,7 +3119,43 @@ func (m *MsgSubmitMisbehaviour) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Signer = string(dAtA[iNdEx:postIndex]) + m.ClientId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Header == nil { + m.Header = &types.Any{} + } + if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/ibc/core/03-connection/handler.go b/x/ibc/core/03-connection/handler.go deleted file mode 100644 index da298038d723..000000000000 --- a/x/ibc/core/03-connection/handler.go +++ /dev/null @@ -1,135 +0,0 @@ -package connection - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/keeper" - "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" -) - -// HandleMsgConnectionOpenInit defines the sdk.Handler for MsgConnectionOpenInit -func HandleMsgConnectionOpenInit(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenInit) (*sdk.Result, error) { - if err := k.ConnOpenInit( - ctx, msg.ConnectionId, msg.ClientId, msg.Counterparty, msg.Version, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open init failed") - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenInit, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenTry defines the sdk.Handler for MsgConnectionOpenTry -func HandleMsgConnectionOpenTry(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenTry) (*sdk.Result, error) { - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v.", targetClient) - } - - if err := k.ConnOpenTry( - ctx, msg.DesiredConnectionId, msg.CounterpartyChosenConnectionId, msg.Counterparty, msg.ClientId, targetClient, - msg.CounterpartyVersions, msg.ProofInit, msg.ProofClient, msg.ProofConsensus, - msg.ProofHeight, msg.ConsensusHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open try failed") - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenTry, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.DesiredConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, msg.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenAck defines the sdk.Handler for MsgConnectionOpenAck -func HandleMsgConnectionOpenAck(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenAck) (*sdk.Result, error) { - targetClient, err := clienttypes.UnpackClientState(msg.ClientState) - if err != nil { - return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v", targetClient) - } - - if err := k.ConnOpenAck( - ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, - msg.ProofTry, msg.ProofClient, msg.ProofConsensus, - msg.ProofHeight, msg.ConsensusHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open ack failed") - } - - connectionEnd, _ := k.GetConnection(ctx, msg.ConnectionId) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenAck, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} - -// HandleMsgConnectionOpenConfirm defines the sdk.Handler for MsgConnectionOpenConfirm -func HandleMsgConnectionOpenConfirm(ctx sdk.Context, k keeper.Keeper, msg *types.MsgConnectionOpenConfirm) (*sdk.Result, error) { - if err := k.ConnOpenConfirm( - ctx, msg.ConnectionId, msg.ProofAck, msg.ProofHeight, - ); err != nil { - return nil, sdkerrors.Wrap(err, "connection handshake open confirm failed") - } - - connectionEnd, _ := k.GetConnection(ctx, msg.ConnectionId) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.EventTypeConnectionOpenConfirm, - sdk.NewAttribute(types.AttributeKeyConnectionID, msg.ConnectionId), - sdk.NewAttribute(types.AttributeKeyClientID, connectionEnd.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), - sdk.NewAttribute(types.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), - ), - sdk.NewEvent( - sdk.EventTypeMessage, - sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), - ), - }) - - return &sdk.Result{ - Events: ctx.EventManager().Events().ToABCIEvents(), - }, nil -} diff --git a/x/ibc/core/03-connection/types/connection.pb.go b/x/ibc/core/03-connection/types/connection.pb.go index deae3b896729..79efbee5d0b3 100644 --- a/x/ibc/core/03-connection/types/connection.pb.go +++ b/x/ibc/core/03-connection/types/connection.pb.go @@ -4,12 +4,17 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + grpc1 "github.com/gogo/protobuf/grpc" types1 "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" types2 "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" _ "github.com/gogo/protobuf/gogoproto" 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" @@ -107,6 +112,43 @@ func (m *MsgConnectionOpenInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenInit proto.InternalMessageInfo +// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response type. +type MsgConnectionOpenInitResponse struct { +} + +func (m *MsgConnectionOpenInitResponse) Reset() { *m = MsgConnectionOpenInitResponse{} } +func (m *MsgConnectionOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenInitResponse) ProtoMessage() {} +func (*MsgConnectionOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{1} +} +func (m *MsgConnectionOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenInitResponse.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 *MsgConnectionOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenInitResponse.Merge(m, src) +} +func (m *MsgConnectionOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenInitResponse proto.InternalMessageInfo + // MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a // connection on Chain B. type MsgConnectionOpenTry struct { @@ -132,7 +174,7 @@ func (m *MsgConnectionOpenTry) Reset() { *m = MsgConnectionOpenTry{} } func (m *MsgConnectionOpenTry) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenTry) ProtoMessage() {} func (*MsgConnectionOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{1} + return fileDescriptor_90572467c054e43a, []int{2} } func (m *MsgConnectionOpenTry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -161,6 +203,43 @@ func (m *MsgConnectionOpenTry) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenTry proto.InternalMessageInfo +// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +type MsgConnectionOpenTryResponse struct { +} + +func (m *MsgConnectionOpenTryResponse) Reset() { *m = MsgConnectionOpenTryResponse{} } +func (m *MsgConnectionOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenTryResponse) ProtoMessage() {} +func (*MsgConnectionOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{3} +} +func (m *MsgConnectionOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenTryResponse.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 *MsgConnectionOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenTryResponse.Merge(m, src) +} +func (m *MsgConnectionOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenTryResponse proto.InternalMessageInfo + // MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to // acknowledge the change of connection state to TRYOPEN on Chain B. type MsgConnectionOpenAck struct { @@ -184,7 +263,7 @@ func (m *MsgConnectionOpenAck) Reset() { *m = MsgConnectionOpenAck{} } func (m *MsgConnectionOpenAck) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenAck) ProtoMessage() {} func (*MsgConnectionOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{2} + return fileDescriptor_90572467c054e43a, []int{4} } func (m *MsgConnectionOpenAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -213,6 +292,43 @@ func (m *MsgConnectionOpenAck) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenAck proto.InternalMessageInfo +// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +type MsgConnectionOpenAckResponse struct { +} + +func (m *MsgConnectionOpenAckResponse) Reset() { *m = MsgConnectionOpenAckResponse{} } +func (m *MsgConnectionOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenAckResponse) ProtoMessage() {} +func (*MsgConnectionOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{5} +} +func (m *MsgConnectionOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenAckResponse.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 *MsgConnectionOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenAckResponse.Merge(m, src) +} +func (m *MsgConnectionOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenAckResponse proto.InternalMessageInfo + // MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of connection state to OPEN on Chain A. type MsgConnectionOpenConfirm struct { @@ -227,7 +343,7 @@ func (m *MsgConnectionOpenConfirm) Reset() { *m = MsgConnectionOpenConfi func (m *MsgConnectionOpenConfirm) String() string { return proto.CompactTextString(m) } func (*MsgConnectionOpenConfirm) ProtoMessage() {} func (*MsgConnectionOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{3} + return fileDescriptor_90572467c054e43a, []int{6} } func (m *MsgConnectionOpenConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -256,6 +372,43 @@ func (m *MsgConnectionOpenConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgConnectionOpenConfirm proto.InternalMessageInfo +// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm response type. +type MsgConnectionOpenConfirmResponse struct { +} + +func (m *MsgConnectionOpenConfirmResponse) Reset() { *m = MsgConnectionOpenConfirmResponse{} } +func (m *MsgConnectionOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgConnectionOpenConfirmResponse) ProtoMessage() {} +func (*MsgConnectionOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_90572467c054e43a, []int{7} +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgConnectionOpenConfirmResponse.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 *MsgConnectionOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.Merge(m, src) +} +func (m *MsgConnectionOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgConnectionOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgConnectionOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgConnectionOpenConfirmResponse proto.InternalMessageInfo + // ConnectionEnd defines a stateful object on a chain connected to another // separate one. NOTE: there must only be 2 defined ConnectionEnds to establish // a connection between two chains. @@ -275,7 +428,7 @@ func (m *ConnectionEnd) Reset() { *m = ConnectionEnd{} } func (m *ConnectionEnd) String() string { return proto.CompactTextString(m) } func (*ConnectionEnd) ProtoMessage() {} func (*ConnectionEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{4} + return fileDescriptor_90572467c054e43a, []int{8} } func (m *ConnectionEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -324,7 +477,7 @@ func (m *IdentifiedConnection) Reset() { *m = IdentifiedConnection{} } func (m *IdentifiedConnection) String() string { return proto.CompactTextString(m) } func (*IdentifiedConnection) ProtoMessage() {} func (*IdentifiedConnection) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{5} + return fileDescriptor_90572467c054e43a, []int{9} } func (m *IdentifiedConnection) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -369,7 +522,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{6} + return fileDescriptor_90572467c054e43a, []int{10} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +561,7 @@ func (m *ClientPaths) Reset() { *m = ClientPaths{} } func (m *ClientPaths) String() string { return proto.CompactTextString(m) } func (*ClientPaths) ProtoMessage() {} func (*ClientPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{7} + return fileDescriptor_90572467c054e43a, []int{11} } func (m *ClientPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -456,7 +609,7 @@ func (m *ConnectionPaths) Reset() { *m = ConnectionPaths{} } func (m *ConnectionPaths) String() string { return proto.CompactTextString(m) } func (*ConnectionPaths) ProtoMessage() {} func (*ConnectionPaths) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{8} + return fileDescriptor_90572467c054e43a, []int{12} } func (m *ConnectionPaths) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -512,7 +665,7 @@ func (m *Version) Reset() { *m = Version{} } func (m *Version) String() string { return proto.CompactTextString(m) } func (*Version) ProtoMessage() {} func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_90572467c054e43a, []int{9} + return fileDescriptor_90572467c054e43a, []int{13} } func (m *Version) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -544,9 +697,13 @@ var xxx_messageInfo_Version proto.InternalMessageInfo func init() { proto.RegisterEnum("ibc.core.connection.v1.State", State_name, State_value) proto.RegisterType((*MsgConnectionOpenInit)(nil), "ibc.core.connection.v1.MsgConnectionOpenInit") + proto.RegisterType((*MsgConnectionOpenInitResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenInitResponse") proto.RegisterType((*MsgConnectionOpenTry)(nil), "ibc.core.connection.v1.MsgConnectionOpenTry") + proto.RegisterType((*MsgConnectionOpenTryResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenTryResponse") proto.RegisterType((*MsgConnectionOpenAck)(nil), "ibc.core.connection.v1.MsgConnectionOpenAck") + proto.RegisterType((*MsgConnectionOpenAckResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenAckResponse") proto.RegisterType((*MsgConnectionOpenConfirm)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirm") + proto.RegisterType((*MsgConnectionOpenConfirmResponse)(nil), "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse") proto.RegisterType((*ConnectionEnd)(nil), "ibc.core.connection.v1.ConnectionEnd") proto.RegisterType((*IdentifiedConnection)(nil), "ibc.core.connection.v1.IdentifiedConnection") proto.RegisterType((*Counterparty)(nil), "ibc.core.connection.v1.Counterparty") @@ -560,77 +717,280 @@ func init() { } var fileDescriptor_90572467c054e43a = []byte{ - // 1110 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0x9d, 0xa4, 0x49, 0x5e, 0xd2, 0x6d, 0xd7, 0x9b, 0xb6, 0xc6, 0xb0, 0x76, 0xd6, 0x80, - 0xa8, 0x10, 0xeb, 0x90, 0x16, 0x71, 0x28, 0xe2, 0xd0, 0x64, 0x83, 0xb0, 0x60, 0xbb, 0x95, 0x9b, - 0x22, 0xd1, 0x4b, 0x94, 0x3a, 0x93, 0x74, 0xd4, 0xc6, 0x8e, 0x6c, 0xb7, 0x6c, 0xfe, 0xc1, 0xaa, - 0x17, 0xb8, 0x70, 0xe0, 0x50, 0x69, 0x25, 0xee, 0xfc, 0x06, 0x8e, 0x2b, 0x4e, 0x7b, 0xe4, 0x64, - 0xa1, 0xf6, 0x02, 0xd7, 0xfc, 0x02, 0xe4, 0x19, 0xdb, 0x19, 0xa7, 0xa9, 0x56, 0xdb, 0x06, 0x71, - 0xca, 0xbc, 0x79, 0xdf, 0x9b, 0x99, 0xf7, 0xcd, 0xf7, 0xde, 0x38, 0xf0, 0x11, 0x3e, 0x34, 0xab, - 0xa6, 0xed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x13, 0x73, 0xe4, 0x98, 0x12, 0x73, 0x4c, 0x5a, 0x59, 0x67, 0x35, 0xed, 0x6b, 0x82, 0xa8, 0xbf, - 0x1b, 0x1c, 0x6e, 0x42, 0x01, 0x1b, 0xad, 0x1a, 0x45, 0x62, 0x52, 0xa4, 0xf0, 0x19, 0x00, 0xf5, - 0x62, 0x0b, 0x7b, 0x62, 0xbe, 0xc2, 0xad, 0x97, 0xea, 0x2b, 0x63, 0x5f, 0xb9, 0xcf, 0x46, 0x06, - 0x3e, 0xd5, 0x28, 0x10, 0x83, 0xd4, 0xe8, 0x56, 0x74, 0x22, 0xba, 0xb3, 0x58, 0x20, 0x71, 0x6b, - 0xd3, 0x3b, 0x52, 0x6f, 0xb4, 0x63, 0x83, 0x58, 0x42, 0x03, 0x96, 0x42, 0xaf, 0x6d, 0xb9, 0xc8, - 0x72, 0x4f, 0x5d, 0x11, 0x48, 0xb8, 0x34, 0xf6, 0x95, 0xd5, 0x44, 0x78, 0x04, 0x50, 0x8d, 0x7b, - 0x74, 0x85, 0x68, 0x42, 0xe8, 0xc1, 0x72, 0xec, 0x8d, 0x68, 0x29, 0xbe, 0x91, 0x16, 0x25, 0xa4, - 0x65, 0x2d, 0x6e, 0x0a, 0x89, 0x15, 0x54, 0x63, 0x29, 0x9e, 0x0a, 0xe9, 0x99, 0x14, 0x6c, 0xe9, - 0x86, 0x82, 0xfd, 0x3d, 0x3b, 0xa3, 0x60, 0xb7, 0xcd, 0xe3, 0xeb, 0x4d, 0x89, 0x7b, 0xab, 0xa6, - 0x64, 0x82, 0x94, 0xac, 0x99, 0x19, 0x15, 0xfc, 0xe1, 0xd8, 0x57, 0x1e, 0xcd, 0xaa, 0xaf, 0xe4, - 0xc2, 0x62, 0xa2, 0xb0, 0xd8, 0x4d, 0x98, 0x4e, 0x95, 0x4e, 0x76, 0xaa, 0xf9, 0x17, 0xdb, 0xb4, - 0x8a, 0xb3, 0x73, 0x54, 0x71, 0x0d, 0xa8, 0x38, 0xdb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 0x7f, 0x75, 0x29, 0x73, 0xaf, 0x2f, 0x65, 0xee, 0xaf, - 0x4b, 0x99, 0xfb, 0xe9, 0x4a, 0x4e, 0xbd, 0xbe, 0x92, 0x53, 0x7f, 0x5e, 0xc9, 0xa9, 0x83, 0x2f, - 0xfa, 0xd8, 0x3b, 0x3a, 0x3d, 0x0c, 0xae, 0xae, 0x6a, 0xda, 0xee, 0xc0, 0x76, 0xc3, 0x9f, 0xc7, - 0x6e, 0xf7, 0xb8, 0xfa, 0xbc, 0x1a, 0xff, 0x4f, 0xfa, 0x74, 0xf3, 0x31, 0xf3, 0x2f, 0xce, 0x1b, - 0x0d, 0x91, 0x7b, 0xb8, 0x40, 0x9e, 0xd9, 0xcd, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x62, 0x66, - 0x42, 0x8b, 0xe9, 0x0d, 0x00, 0x00, + // 1219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0xf3, 0xa3, 0x49, 0x5e, 0xd2, 0x6d, 0xeb, 0x4d, 0x5b, 0x63, 0xb6, 0x76, 0xd6, 0x80, + 0xa8, 0xd0, 0x36, 0xd9, 0xb4, 0x0b, 0x42, 0x45, 0x1c, 0x92, 0x6c, 0x10, 0x11, 0xb4, 0x5b, 0xb9, + 0x29, 0x12, 0xbd, 0x44, 0xa9, 0x33, 0x49, 0xad, 0x34, 0x76, 0x64, 0xbb, 0xdd, 0x0d, 0x57, 0x2e, + 0xab, 0x5e, 0xe0, 0xc2, 0x81, 0x43, 0xa5, 0x95, 0xb8, 0xf3, 0x37, 0x70, 0x5c, 0x71, 0xda, 0x23, + 0xa7, 0x08, 0xb5, 0x17, 0xb8, 0xe6, 0xc6, 0x0d, 0x79, 0xc6, 0x76, 0xc6, 0x89, 0xa3, 0x6d, 0xda, + 0x22, 0x4e, 0x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, 0xad, 0x0d, 0xea, 0xdf, 0x08, 0x56, 0xbf, 0x87, 0xcc, + 0xa3, 0x39, 0xfc, 0x4c, 0xdb, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x85, 0x21, 0x71, 0xfb, 0x6a, + 0x10, 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 { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ConnectionOpenInit(ctx context.Context, in *MsgConnectionOpenInit, opts ...grpc.CallOption) (*MsgConnectionOpenInitResponse, error) { + out := new(MsgConnectionOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenTry(ctx context.Context, in *MsgConnectionOpenTry, opts ...grpc.CallOption) (*MsgConnectionOpenTryResponse, error) { + out := new(MsgConnectionOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenAck(ctx context.Context, in *MsgConnectionOpenAck, opts ...grpc.CallOption) (*MsgConnectionOpenAckResponse, error) { + out := new(MsgConnectionOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ConnectionOpenConfirm(ctx context.Context, in *MsgConnectionOpenConfirm, opts ...grpc.CallOption) (*MsgConnectionOpenConfirmResponse, error) { + out := new(MsgConnectionOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + ConnectionOpenInit(context.Context, *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) + // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + ConnectionOpenTry(context.Context, *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) + // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + ConnectionOpenAck(context.Context, *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) + // ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. + ConnectionOpenConfirm(context.Context, *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ConnectionOpenInit(ctx context.Context, req *MsgConnectionOpenInit) (*MsgConnectionOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenInit not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenTry(ctx context.Context, req *MsgConnectionOpenTry) (*MsgConnectionOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenTry not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenAck(ctx context.Context, req *MsgConnectionOpenAck) (*MsgConnectionOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenAck not implemented") +} +func (*UnimplementedMsgServer) ConnectionOpenConfirm(ctx context.Context, req *MsgConnectionOpenConfirm) (*MsgConnectionOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConnectionOpenConfirm not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ConnectionOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenInit(ctx, req.(*MsgConnectionOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenTry(ctx, req.(*MsgConnectionOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenAck(ctx, req.(*MsgConnectionOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ConnectionOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgConnectionOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ConnectionOpenConfirm(ctx, req.(*MsgConnectionOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.connection.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConnectionOpenInit", + Handler: _Msg_ConnectionOpenInit_Handler, + }, + { + MethodName: "ConnectionOpenTry", + Handler: _Msg_ConnectionOpenTry_Handler, + }, + { + MethodName: "ConnectionOpenAck", + Handler: _Msg_ConnectionOpenAck_Handler, + }, + { + MethodName: "ConnectionOpenConfirm", + Handler: _Msg_ConnectionOpenConfirm_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/connection/v1/connection.proto", } func (m *MsgConnectionOpenInit) Marshal() (dAtA []byte, err error) { @@ -694,6 +1054,29 @@ func (m *MsgConnectionOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenInitResponse) 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 *MsgConnectionOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenTry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -817,6 +1200,29 @@ func (m *MsgConnectionOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenTryResponse) 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 *MsgConnectionOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenAck) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -921,6 +1327,29 @@ func (m *MsgConnectionOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgConnectionOpenAckResponse) 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 *MsgConnectionOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgConnectionOpenConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -975,6 +1404,29 @@ func (m *MsgConnectionOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *MsgConnectionOpenConfirmResponse) 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 *MsgConnectionOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgConnectionOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *ConnectionEnd) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1285,6 +1737,15 @@ func (m *MsgConnectionOpenInit) Size() (n int) { return n } +func (m *MsgConnectionOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenTry) Size() (n int) { if m == nil { return 0 @@ -1338,6 +1799,15 @@ func (m *MsgConnectionOpenTry) Size() (n int) { return n } +func (m *MsgConnectionOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenAck) Size() (n int) { if m == nil { return 0 @@ -1383,6 +1853,15 @@ func (m *MsgConnectionOpenAck) Size() (n int) { return n } +func (m *MsgConnectionOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgConnectionOpenConfirm) Size() (n int) { if m == nil { return 0 @@ -1406,6 +1885,15 @@ func (m *MsgConnectionOpenConfirm) Size() (n int) { return n } +func (m *MsgConnectionOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *ConnectionEnd) Size() (n int) { if m == nil { return 0 @@ -1750,6 +2238,59 @@ func (m *MsgConnectionOpenInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenInitResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2200,6 +2741,59 @@ func (m *MsgConnectionOpenTry) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenTryResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2585,6 +3179,59 @@ func (m *MsgConnectionOpenAck) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenAckResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2769,6 +3416,59 @@ func (m *MsgConnectionOpenConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgConnectionOpenConfirmResponse) 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 ErrIntOverflowConnection + } + 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: MsgConnectionOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgConnectionOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipConnection(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthConnection + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ConnectionEnd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/04-channel/types/channel.pb.go b/x/ibc/core/04-channel/types/channel.pb.go index dc69ed0b5f61..e06a7ed7ec34 100644 --- a/x/ibc/core/04-channel/types/channel.pb.go +++ b/x/ibc/core/04-channel/types/channel.pb.go @@ -4,10 +4,15 @@ package types import ( + context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + grpc1 "github.com/gogo/protobuf/grpc" _ "github.com/gogo/protobuf/gogoproto" 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" @@ -142,7 +147,44 @@ func (m *MsgChannelOpenInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +type MsgChannelOpenInitResponse struct { +} + +func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } +func (m *MsgChannelOpenInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenInitResponse) ProtoMessage() {} +func (*MsgChannelOpenInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{1} +} +func (m *MsgChannelOpenInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenInitResponse.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 *MsgChannelOpenInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenInitResponse.Merge(m, src) +} +func (m *MsgChannelOpenInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenInitResponse proto.InternalMessageInfo + +// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. type MsgChannelOpenTry struct { PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` @@ -159,7 +201,7 @@ func (m *MsgChannelOpenTry) Reset() { *m = MsgChannelOpenTry{} } func (m *MsgChannelOpenTry) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenTry) ProtoMessage() {} func (*MsgChannelOpenTry) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{1} + return fileDescriptor_c3a07336710636a0, []int{2} } func (m *MsgChannelOpenTry) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,6 +230,43 @@ func (m *MsgChannelOpenTry) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo +// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +type MsgChannelOpenTryResponse struct { +} + +func (m *MsgChannelOpenTryResponse) Reset() { *m = MsgChannelOpenTryResponse{} } +func (m *MsgChannelOpenTryResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenTryResponse) ProtoMessage() {} +func (*MsgChannelOpenTryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{3} +} +func (m *MsgChannelOpenTryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenTryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenTryResponse.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 *MsgChannelOpenTryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenTryResponse.Merge(m, src) +} +func (m *MsgChannelOpenTryResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenTryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenTryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenTryResponse proto.InternalMessageInfo + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. type MsgChannelOpenAck struct { @@ -204,7 +283,7 @@ func (m *MsgChannelOpenAck) Reset() { *m = MsgChannelOpenAck{} } func (m *MsgChannelOpenAck) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenAck) ProtoMessage() {} func (*MsgChannelOpenAck) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{2} + return fileDescriptor_c3a07336710636a0, []int{4} } func (m *MsgChannelOpenAck) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -233,6 +312,43 @@ func (m *MsgChannelOpenAck) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenAck proto.InternalMessageInfo +// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +type MsgChannelOpenAckResponse struct { +} + +func (m *MsgChannelOpenAckResponse) Reset() { *m = MsgChannelOpenAckResponse{} } +func (m *MsgChannelOpenAckResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenAckResponse) ProtoMessage() {} +func (*MsgChannelOpenAckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{5} +} +func (m *MsgChannelOpenAckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenAckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenAckResponse.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 *MsgChannelOpenAckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenAckResponse.Merge(m, src) +} +func (m *MsgChannelOpenAckResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenAckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenAckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenAckResponse proto.InternalMessageInfo + // MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to // acknowledge the change of channel state to OPEN on Chain A. type MsgChannelOpenConfirm struct { @@ -247,7 +363,7 @@ func (m *MsgChannelOpenConfirm) Reset() { *m = MsgChannelOpenConfirm{} } func (m *MsgChannelOpenConfirm) String() string { return proto.CompactTextString(m) } func (*MsgChannelOpenConfirm) ProtoMessage() {} func (*MsgChannelOpenConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{3} + return fileDescriptor_c3a07336710636a0, []int{6} } func (m *MsgChannelOpenConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,6 +392,43 @@ func (m *MsgChannelOpenConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenConfirm proto.InternalMessageInfo +// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response type. +type MsgChannelOpenConfirmResponse struct { +} + +func (m *MsgChannelOpenConfirmResponse) Reset() { *m = MsgChannelOpenConfirmResponse{} } +func (m *MsgChannelOpenConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelOpenConfirmResponse) ProtoMessage() {} +func (*MsgChannelOpenConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{7} +} +func (m *MsgChannelOpenConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelOpenConfirmResponse.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 *MsgChannelOpenConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelOpenConfirmResponse.Merge(m, src) +} +func (m *MsgChannelOpenConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelOpenConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelOpenConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelOpenConfirmResponse proto.InternalMessageInfo + // MsgChannelCloseInit defines a msg sent by a Relayer to Chain A // to close a channel with Chain B. type MsgChannelCloseInit struct { @@ -288,7 +441,7 @@ func (m *MsgChannelCloseInit) Reset() { *m = MsgChannelCloseInit{} } func (m *MsgChannelCloseInit) String() string { return proto.CompactTextString(m) } func (*MsgChannelCloseInit) ProtoMessage() {} func (*MsgChannelCloseInit) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{4} + return fileDescriptor_c3a07336710636a0, []int{8} } func (m *MsgChannelCloseInit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -317,6 +470,43 @@ func (m *MsgChannelCloseInit) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelCloseInit proto.InternalMessageInfo +// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +type MsgChannelCloseInitResponse struct { +} + +func (m *MsgChannelCloseInitResponse) Reset() { *m = MsgChannelCloseInitResponse{} } +func (m *MsgChannelCloseInitResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseInitResponse) ProtoMessage() {} +func (*MsgChannelCloseInitResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{9} +} +func (m *MsgChannelCloseInitResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseInitResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseInitResponse.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 *MsgChannelCloseInitResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseInitResponse.Merge(m, src) +} +func (m *MsgChannelCloseInitResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseInitResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseInitResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseInitResponse proto.InternalMessageInfo + // MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B // to acknowledge the change of channel state to CLOSED on Chain A. type MsgChannelCloseConfirm struct { @@ -331,7 +521,7 @@ func (m *MsgChannelCloseConfirm) Reset() { *m = MsgChannelCloseConfirm{} func (m *MsgChannelCloseConfirm) String() string { return proto.CompactTextString(m) } func (*MsgChannelCloseConfirm) ProtoMessage() {} func (*MsgChannelCloseConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{5} + return fileDescriptor_c3a07336710636a0, []int{10} } func (m *MsgChannelCloseConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -360,6 +550,43 @@ func (m *MsgChannelCloseConfirm) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelCloseConfirm proto.InternalMessageInfo +// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response type. +type MsgChannelCloseConfirmResponse struct { +} + +func (m *MsgChannelCloseConfirmResponse) Reset() { *m = MsgChannelCloseConfirmResponse{} } +func (m *MsgChannelCloseConfirmResponse) String() string { return proto.CompactTextString(m) } +func (*MsgChannelCloseConfirmResponse) ProtoMessage() {} +func (*MsgChannelCloseConfirmResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{11} +} +func (m *MsgChannelCloseConfirmResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgChannelCloseConfirmResponse.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 *MsgChannelCloseConfirmResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgChannelCloseConfirmResponse.Merge(m, src) +} +func (m *MsgChannelCloseConfirmResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgChannelCloseConfirmResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgChannelCloseConfirmResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgChannelCloseConfirmResponse proto.InternalMessageInfo + // MsgRecvPacket receives incoming IBC packet type MsgRecvPacket struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -372,7 +599,7 @@ func (m *MsgRecvPacket) Reset() { *m = MsgRecvPacket{} } func (m *MsgRecvPacket) String() string { return proto.CompactTextString(m) } func (*MsgRecvPacket) ProtoMessage() {} func (*MsgRecvPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{6} + return fileDescriptor_c3a07336710636a0, []int{12} } func (m *MsgRecvPacket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -401,6 +628,43 @@ func (m *MsgRecvPacket) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRecvPacket proto.InternalMessageInfo +// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +type MsgRecvPacketResponse struct { +} + +func (m *MsgRecvPacketResponse) Reset() { *m = MsgRecvPacketResponse{} } +func (m *MsgRecvPacketResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRecvPacketResponse) ProtoMessage() {} +func (*MsgRecvPacketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{13} +} +func (m *MsgRecvPacketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRecvPacketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRecvPacketResponse.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 *MsgRecvPacketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRecvPacketResponse.Merge(m, src) +} +func (m *MsgRecvPacketResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRecvPacketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRecvPacketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRecvPacketResponse proto.InternalMessageInfo + // MsgTimeout receives timed-out packet type MsgTimeout struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -414,7 +678,7 @@ func (m *MsgTimeout) Reset() { *m = MsgTimeout{} } func (m *MsgTimeout) String() string { return proto.CompactTextString(m) } func (*MsgTimeout) ProtoMessage() {} func (*MsgTimeout) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{7} + return fileDescriptor_c3a07336710636a0, []int{14} } func (m *MsgTimeout) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -443,6 +707,43 @@ func (m *MsgTimeout) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeout proto.InternalMessageInfo +// MsgTimeoutResponse defines the Msg/Timeout response type. +type MsgTimeoutResponse struct { +} + +func (m *MsgTimeoutResponse) Reset() { *m = MsgTimeoutResponse{} } +func (m *MsgTimeoutResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutResponse) ProtoMessage() {} +func (*MsgTimeoutResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{15} +} +func (m *MsgTimeoutResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutResponse.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 *MsgTimeoutResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutResponse.Merge(m, src) +} +func (m *MsgTimeoutResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutResponse proto.InternalMessageInfo + // MsgTimeoutOnClose timed-out packet upon counterparty channel closure. type MsgTimeoutOnClose struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -457,7 +758,7 @@ func (m *MsgTimeoutOnClose) Reset() { *m = MsgTimeoutOnClose{} } func (m *MsgTimeoutOnClose) String() string { return proto.CompactTextString(m) } func (*MsgTimeoutOnClose) ProtoMessage() {} func (*MsgTimeoutOnClose) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{8} + return fileDescriptor_c3a07336710636a0, []int{16} } func (m *MsgTimeoutOnClose) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,6 +787,43 @@ func (m *MsgTimeoutOnClose) XXX_DiscardUnknown() { var xxx_messageInfo_MsgTimeoutOnClose proto.InternalMessageInfo +// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +type MsgTimeoutOnCloseResponse struct { +} + +func (m *MsgTimeoutOnCloseResponse) Reset() { *m = MsgTimeoutOnCloseResponse{} } +func (m *MsgTimeoutOnCloseResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTimeoutOnCloseResponse) ProtoMessage() {} +func (*MsgTimeoutOnCloseResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{17} +} +func (m *MsgTimeoutOnCloseResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTimeoutOnCloseResponse.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 *MsgTimeoutOnCloseResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTimeoutOnCloseResponse.Merge(m, src) +} +func (m *MsgTimeoutOnCloseResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTimeoutOnCloseResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTimeoutOnCloseResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTimeoutOnCloseResponse proto.InternalMessageInfo + // MsgAcknowledgement receives incoming IBC acknowledgement type MsgAcknowledgement struct { Packet Packet `protobuf:"bytes,1,opt,name=packet,proto3" json:"packet"` @@ -499,7 +837,7 @@ func (m *MsgAcknowledgement) Reset() { *m = MsgAcknowledgement{} } func (m *MsgAcknowledgement) String() string { return proto.CompactTextString(m) } func (*MsgAcknowledgement) ProtoMessage() {} func (*MsgAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{9} + return fileDescriptor_c3a07336710636a0, []int{18} } func (m *MsgAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -528,6 +866,43 @@ func (m *MsgAcknowledgement) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAcknowledgement proto.InternalMessageInfo +// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +type MsgAcknowledgementResponse struct { +} + +func (m *MsgAcknowledgementResponse) Reset() { *m = MsgAcknowledgementResponse{} } +func (m *MsgAcknowledgementResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAcknowledgementResponse) ProtoMessage() {} +func (*MsgAcknowledgementResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{19} +} +func (m *MsgAcknowledgementResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAcknowledgementResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAcknowledgementResponse.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 *MsgAcknowledgementResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAcknowledgementResponse.Merge(m, src) +} +func (m *MsgAcknowledgementResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAcknowledgementResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAcknowledgementResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAcknowledgementResponse proto.InternalMessageInfo + // Channel defines pipeline for exactly-once packet delivery between specific // modules on separate blockchains, which has at least one end capable of // sending packets and one end capable of receiving packets. @@ -549,7 +924,7 @@ func (m *Channel) Reset() { *m = Channel{} } func (m *Channel) String() string { return proto.CompactTextString(m) } func (*Channel) ProtoMessage() {} func (*Channel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{10} + return fileDescriptor_c3a07336710636a0, []int{20} } func (m *Channel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +977,7 @@ func (m *IdentifiedChannel) Reset() { *m = IdentifiedChannel{} } func (m *IdentifiedChannel) String() string { return proto.CompactTextString(m) } func (*IdentifiedChannel) ProtoMessage() {} func (*IdentifiedChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{11} + return fileDescriptor_c3a07336710636a0, []int{21} } func (m *IdentifiedChannel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -643,7 +1018,7 @@ func (m *Counterparty) Reset() { *m = Counterparty{} } func (m *Counterparty) String() string { return proto.CompactTextString(m) } func (*Counterparty) ProtoMessage() {} func (*Counterparty) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{12} + return fileDescriptor_c3a07336710636a0, []int{22} } func (m *Counterparty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -698,7 +1073,7 @@ func (m *Packet) Reset() { *m = Packet{} } func (m *Packet) String() string { return proto.CompactTextString(m) } func (*Packet) ProtoMessage() {} func (*Packet) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{13} + return fileDescriptor_c3a07336710636a0, []int{23} } func (m *Packet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -744,7 +1119,7 @@ func (m *PacketAckCommitment) Reset() { *m = PacketAckCommitment{} } func (m *PacketAckCommitment) String() string { return proto.CompactTextString(m) } func (*PacketAckCommitment) ProtoMessage() {} func (*PacketAckCommitment) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{14} + return fileDescriptor_c3a07336710636a0, []int{24} } func (m *PacketAckCommitment) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -793,7 +1168,7 @@ func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } func (*Acknowledgement) ProtoMessage() {} func (*Acknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{15} + return fileDescriptor_c3a07336710636a0, []int{25} } func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -871,15 +1246,25 @@ func init() { proto.RegisterEnum("ibc.core.channel.v1.State", State_name, State_value) proto.RegisterEnum("ibc.core.channel.v1.Order", Order_name, Order_value) proto.RegisterType((*MsgChannelOpenInit)(nil), "ibc.core.channel.v1.MsgChannelOpenInit") + proto.RegisterType((*MsgChannelOpenInitResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenInitResponse") proto.RegisterType((*MsgChannelOpenTry)(nil), "ibc.core.channel.v1.MsgChannelOpenTry") + proto.RegisterType((*MsgChannelOpenTryResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenTryResponse") proto.RegisterType((*MsgChannelOpenAck)(nil), "ibc.core.channel.v1.MsgChannelOpenAck") + proto.RegisterType((*MsgChannelOpenAckResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenAckResponse") proto.RegisterType((*MsgChannelOpenConfirm)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirm") + proto.RegisterType((*MsgChannelOpenConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelOpenConfirmResponse") proto.RegisterType((*MsgChannelCloseInit)(nil), "ibc.core.channel.v1.MsgChannelCloseInit") + proto.RegisterType((*MsgChannelCloseInitResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseInitResponse") proto.RegisterType((*MsgChannelCloseConfirm)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirm") + proto.RegisterType((*MsgChannelCloseConfirmResponse)(nil), "ibc.core.channel.v1.MsgChannelCloseConfirmResponse") proto.RegisterType((*MsgRecvPacket)(nil), "ibc.core.channel.v1.MsgRecvPacket") + proto.RegisterType((*MsgRecvPacketResponse)(nil), "ibc.core.channel.v1.MsgRecvPacketResponse") proto.RegisterType((*MsgTimeout)(nil), "ibc.core.channel.v1.MsgTimeout") + proto.RegisterType((*MsgTimeoutResponse)(nil), "ibc.core.channel.v1.MsgTimeoutResponse") proto.RegisterType((*MsgTimeoutOnClose)(nil), "ibc.core.channel.v1.MsgTimeoutOnClose") + proto.RegisterType((*MsgTimeoutOnCloseResponse)(nil), "ibc.core.channel.v1.MsgTimeoutOnCloseResponse") proto.RegisterType((*MsgAcknowledgement)(nil), "ibc.core.channel.v1.MsgAcknowledgement") + proto.RegisterType((*MsgAcknowledgementResponse)(nil), "ibc.core.channel.v1.MsgAcknowledgementResponse") proto.RegisterType((*Channel)(nil), "ibc.core.channel.v1.Channel") proto.RegisterType((*IdentifiedChannel)(nil), "ibc.core.channel.v1.IdentifiedChannel") proto.RegisterType((*Counterparty)(nil), "ibc.core.channel.v1.Counterparty") @@ -891,99 +1276,538 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 1465 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6b, 0x1b, 0xc7, - 0x17, 0xd7, 0x4a, 0x2b, 0xd9, 0x7e, 0x96, 0x6d, 0x79, 0xfc, 0x23, 0x8a, 0x9c, 0x68, 0x95, 0xe5, - 0xfb, 0x05, 0x37, 0x25, 0x76, 0x9c, 0x86, 0xfe, 0x08, 0x3d, 0xd4, 0x92, 0x15, 0x2c, 0x92, 0x48, - 0x66, 0xac, 0x14, 0xea, 0x8b, 0x2a, 0xaf, 0x26, 0xd2, 0x22, 0x6b, 0x47, 0xdd, 0x5d, 0x3b, 0xf1, - 0x7f, 0x10, 0x0c, 0x85, 0x9e, 0x0b, 0x86, 0x40, 0x29, 0x14, 0x0a, 0xed, 0xb1, 0x7f, 0x40, 0x2f, - 0x39, 0xe6, 0x96, 0x9e, 0x96, 0x92, 0x1c, 0x9a, 0xf3, 0xfe, 0x03, 0x2d, 0x3b, 0x33, 0x2b, 0xed, - 0xca, 0x52, 0x48, 0x9a, 0x5a, 0x50, 0xe8, 0x69, 0xe7, 0xbd, 0xf7, 0x99, 0x99, 0xf7, 0x3e, 0xef, - 0xcd, 0xaf, 0x85, 0x2b, 0xfa, 0xbe, 0xb6, 0xae, 0x51, 0x93, 0xac, 0x6b, 0xad, 0xba, 0x61, 0x90, - 0x83, 0xf5, 0xa3, 0x0d, 0xbf, 0xb9, 0xd6, 0x35, 0xa9, 0x4d, 0xd1, 0x82, 0xbe, 0xaf, 0xad, 0x79, - 0x90, 0x35, 0x5f, 0x7f, 0xb4, 0x91, 0x59, 0x6c, 0xd2, 0x26, 0x65, 0xf6, 0x75, 0xaf, 0xc5, 0xa1, - 0x19, 0xa5, 0x3f, 0xda, 0x81, 0x4e, 0x0c, 0x9b, 0x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2e, 0xb1, 0xf6, 0x13, 0xec, 0xd7, 0xe0, 0x07, 0x7f, 0x05, 0x00, 0x00, 0xff, - 0xff, 0x7f, 0x85, 0xc2, 0xbb, 0x8b, 0x14, 0x00, 0x00, + // 1708 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, + 0x15, 0xd7, 0x07, 0xf5, 0xe1, 0x17, 0xd9, 0x96, 0xc7, 0x1f, 0x51, 0xe8, 0x58, 0xd4, 0x12, 0xed, + 0xae, 0x9b, 0x62, 0xa5, 0x24, 0xbb, 0xe8, 0x47, 0xd0, 0x43, 0x2d, 0x59, 0x8b, 0x08, 0xd9, 0x58, + 0xc6, 0x58, 0x29, 0x50, 0xa3, 0x80, 0x2a, 0x53, 0x13, 0x89, 0x90, 0x45, 0xaa, 0x24, 0x6d, 0xaf, + 0xff, 0x83, 0x85, 0x81, 0x02, 0x3d, 0x17, 0x30, 0xb0, 0x40, 0x51, 0xa0, 0x40, 0x81, 0xee, 0xb1, + 0x7f, 0x40, 0x2f, 0x7b, 0xdc, 0xdb, 0xf6, 0x44, 0x14, 0xc9, 0xa1, 0x39, 0xeb, 0x1f, 0x68, 0xc1, + 0x99, 0x21, 0x45, 0x52, 0x54, 0xac, 0x34, 0xb5, 0x80, 0x02, 0x3d, 0x89, 0xf3, 0xde, 0x6f, 0xde, + 0xbc, 0xf9, 0xbd, 0xc7, 0x37, 0xf3, 0x28, 0xf8, 0x40, 0x3d, 0x51, 0x2a, 0x8a, 0x6e, 0x90, 0x8a, + 0xd2, 0xef, 0x68, 0x1a, 0x39, 0xad, 0x9c, 0x3f, 0x72, 0x1f, 0xcb, 0x23, 0x43, 0xb7, 0x74, 0xb4, + 0xae, 0x9e, 0x28, 0x65, 0x07, 0x52, 0x76, 0xe5, 0xe7, 0x8f, 0xc4, 0x8d, 0x9e, 0xde, 0xd3, 0x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x64, 0x78, 0x41, 0x44, 0x0f, 0x21, 0x65, 0x5a, 0x1d, 0x8b, 0x50, 0x86, + 0x56, 0x02, 0x0e, 0x4e, 0x18, 0x3a, 0x72, 0x10, 0x98, 0x01, 0xd1, 0x8f, 0x20, 0xab, 0x1b, 0x5d, + 0x62, 0xa8, 0x5a, 0x8f, 0x52, 0x32, 0x6b, 0x52, 0xd3, 0x01, 0x61, 0x0f, 0x8b, 0x9e, 0x41, 0xce, + 0x7f, 0x55, 0xe3, 0xc5, 0xe0, 0x83, 0xe8, 0x26, 0xc1, 0x07, 0xe4, 0x81, 0x09, 0x4c, 0x46, 0x35, + 0x58, 0x55, 0x74, 0x4d, 0x23, 0x8a, 0xa5, 0xea, 0x5a, 0xbb, 0xaf, 0x8f, 0xcc, 0x82, 0x50, 0x4a, + 0xee, 0x2e, 0x55, 0xc5, 0xb1, 0x2d, 0x6d, 0xb9, 0xf7, 0xc5, 0x00, 0x40, 0xc6, 0x2b, 0x13, 0xc9, + 0x53, 0x7d, 0x64, 0xa2, 0x02, 0x64, 0x02, 0x6d, 0x06, 0x76, 0x87, 0x4f, 0x04, 0x87, 0x49, 0xf9, + 0x9f, 0x09, 0x58, 0x6b, 0x74, 0x89, 0x66, 0xa9, 0x2f, 0x55, 0xaf, 0xb3, 0xfa, 0x3f, 0x63, 0x51, + 0x8c, 0xa1, 0xbb, 0x93, 0xdb, 0x07, 0x7f, 0x83, 0xf9, 0x4d, 0x63, 0x27, 0x70, 0xd3, 0x60, 0xf7, + 0xdf, 0xc9, 0x95, 0x82, 0x33, 0x7d, 0x01, 0x39, 0xff, 0x06, 0x16, 0x70, 0x97, 0xe1, 0x0b, 0xff, + 0x2b, 0x09, 0x69, 0x7e, 0xe8, 0x8b, 0x90, 0x75, 0xcb, 0x14, 0x5d, 0x54, 0xc0, 0xde, 0xd8, 0x29, + 0xc0, 0xa6, 0x7e, 0x66, 0x28, 0xa4, 0xed, 0xac, 0xc9, 0xd7, 0xf0, 0x15, 0x60, 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, 0x0c, + 0x01, 0x67, 0xbf, 0xbc, 0x33, 0xee, 0xdc, 0x55, 0xfc, 0xcd, 0xab, 0x62, 0xfc, 0xdb, 0x57, 0xc5, + 0xf8, 0x3f, 0x5e, 0x15, 0xe3, 0xbf, 0x7b, 0x5d, 0x8c, 0x7d, 0xfb, 0xba, 0x18, 0xfb, 0xfb, 0xeb, + 0x62, 0xec, 0xf8, 0x27, 0x3d, 0xd5, 0xea, 0x9f, 0x9d, 0x94, 0x15, 0x7d, 0x58, 0x51, 0x74, 0x73, + 0xa8, 0x9b, 0xfc, 0xe7, 0x63, 0xb3, 0x3b, 0xa8, 0x7c, 0x51, 0xf1, 0xfe, 0x6f, 0x79, 0xf8, 0xe9, + 0xc7, 0xee, 0x1f, 0x38, 0xd6, 0xe5, 0x88, 0x98, 0x27, 0x69, 0xfa, 0x87, 0xcb, 0x27, 0xff, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0xdf, 0x36, 0x4a, 0x13, 0xe1, 0x19, 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 { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) ChannelOpenInit(ctx context.Context, in *MsgChannelOpenInit, opts ...grpc.CallOption) (*MsgChannelOpenInitResponse, error) { + out := new(MsgChannelOpenInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenTry(ctx context.Context, in *MsgChannelOpenTry, opts ...grpc.CallOption) (*MsgChannelOpenTryResponse, error) { + out := new(MsgChannelOpenTryResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenTry", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenAck(ctx context.Context, in *MsgChannelOpenAck, opts ...grpc.CallOption) (*MsgChannelOpenAckResponse, error) { + out := new(MsgChannelOpenAckResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenAck", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelOpenConfirm(ctx context.Context, in *MsgChannelOpenConfirm, opts ...grpc.CallOption) (*MsgChannelOpenConfirmResponse, error) { + out := new(MsgChannelOpenConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseInit(ctx context.Context, in *MsgChannelCloseInit, opts ...grpc.CallOption) (*MsgChannelCloseInitResponse, error) { + out := new(MsgChannelCloseInitResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseInit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ChannelCloseConfirm(ctx context.Context, in *MsgChannelCloseConfirm, opts ...grpc.CallOption) (*MsgChannelCloseConfirmResponse, error) { + out := new(MsgChannelCloseConfirmResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RecvPacket(ctx context.Context, in *MsgRecvPacket, opts ...grpc.CallOption) (*MsgRecvPacketResponse, error) { + out := new(MsgRecvPacketResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/RecvPacket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Timeout(ctx context.Context, in *MsgTimeout, opts ...grpc.CallOption) (*MsgTimeoutResponse, error) { + out := new(MsgTimeoutResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Timeout", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TimeoutOnClose(ctx context.Context, in *MsgTimeoutOnClose, opts ...grpc.CallOption) (*MsgTimeoutOnCloseResponse, error) { + out := new(MsgTimeoutOnCloseResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/TimeoutOnClose", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Acknowledgement(ctx context.Context, in *MsgAcknowledgement, opts ...grpc.CallOption) (*MsgAcknowledgementResponse, error) { + out := new(MsgAcknowledgementResponse) + err := c.cc.Invoke(ctx, "/ibc.core.channel.v1.Msg/Acknowledgement", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + ChannelOpenInit(context.Context, *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) + // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + ChannelOpenTry(context.Context, *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) + // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + ChannelOpenAck(context.Context, *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) + // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + ChannelOpenConfirm(context.Context, *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) + // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + ChannelCloseInit(context.Context, *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) + // ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. + ChannelCloseConfirm(context.Context, *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) + // RecvPacket defines a rpc handler method for MsgRecvPacket. + RecvPacket(context.Context, *MsgRecvPacket) (*MsgRecvPacketResponse, error) + // Timeout defines a rpc handler method for MsgTimeout. + Timeout(context.Context, *MsgTimeout) (*MsgTimeoutResponse, error) + // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + TimeoutOnClose(context.Context, *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) + // Acknowledgement defines a rpc handler method for MsgAcknowledgement. + Acknowledgement(context.Context, *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) ChannelOpenInit(ctx context.Context, req *MsgChannelOpenInit) (*MsgChannelOpenInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenInit not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenTry(ctx context.Context, req *MsgChannelOpenTry) (*MsgChannelOpenTryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenTry not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenAck(ctx context.Context, req *MsgChannelOpenAck) (*MsgChannelOpenAckResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenAck not implemented") +} +func (*UnimplementedMsgServer) ChannelOpenConfirm(ctx context.Context, req *MsgChannelOpenConfirm) (*MsgChannelOpenConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelOpenConfirm not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseInit(ctx context.Context, req *MsgChannelCloseInit) (*MsgChannelCloseInitResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseInit not implemented") +} +func (*UnimplementedMsgServer) ChannelCloseConfirm(ctx context.Context, req *MsgChannelCloseConfirm) (*MsgChannelCloseConfirmResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChannelCloseConfirm not implemented") +} +func (*UnimplementedMsgServer) RecvPacket(ctx context.Context, req *MsgRecvPacket) (*MsgRecvPacketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecvPacket not implemented") +} +func (*UnimplementedMsgServer) Timeout(ctx context.Context, req *MsgTimeout) (*MsgTimeoutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Timeout not implemented") +} +func (*UnimplementedMsgServer) TimeoutOnClose(ctx context.Context, req *MsgTimeoutOnClose) (*MsgTimeoutOnCloseResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TimeoutOnClose not implemented") +} +func (*UnimplementedMsgServer) Acknowledgement(ctx context.Context, req *MsgAcknowledgement) (*MsgAcknowledgementResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Acknowledgement not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_ChannelOpenInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenInit(ctx, req.(*MsgChannelOpenInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenTry_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenTry) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenTry(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenTry", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenTry(ctx, req.(*MsgChannelOpenTry)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenAck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenAck) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenAck(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenAck", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenAck(ctx, req.(*MsgChannelOpenAck)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelOpenConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelOpenConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelOpenConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelOpenConfirm(ctx, req.(*MsgChannelOpenConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseInit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseInit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseInit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseInit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseInit(ctx, req.(*MsgChannelCloseInit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ChannelCloseConfirm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgChannelCloseConfirm) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ChannelCloseConfirm(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ChannelCloseConfirm(ctx, req.(*MsgChannelCloseConfirm)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RecvPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRecvPacket) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RecvPacket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/RecvPacket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RecvPacket(ctx, req.(*MsgRecvPacket)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Timeout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeout) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Timeout(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Timeout", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Timeout(ctx, req.(*MsgTimeout)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TimeoutOnClose_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTimeoutOnClose) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TimeoutOnClose(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/TimeoutOnClose", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TimeoutOnClose(ctx, req.(*MsgTimeoutOnClose)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Acknowledgement_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAcknowledgement) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Acknowledgement(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.core.channel.v1.Msg/Acknowledgement", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Acknowledgement(ctx, req.(*MsgAcknowledgement)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.core.channel.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ChannelOpenInit", + Handler: _Msg_ChannelOpenInit_Handler, + }, + { + MethodName: "ChannelOpenTry", + Handler: _Msg_ChannelOpenTry_Handler, + }, + { + MethodName: "ChannelOpenAck", + Handler: _Msg_ChannelOpenAck_Handler, + }, + { + MethodName: "ChannelOpenConfirm", + Handler: _Msg_ChannelOpenConfirm_Handler, + }, + { + MethodName: "ChannelCloseInit", + Handler: _Msg_ChannelCloseInit_Handler, + }, + { + MethodName: "ChannelCloseConfirm", + Handler: _Msg_ChannelCloseConfirm_Handler, + }, + { + MethodName: "RecvPacket", + Handler: _Msg_RecvPacket_Handler, + }, + { + MethodName: "Timeout", + Handler: _Msg_Timeout_Handler, + }, + { + MethodName: "TimeoutOnClose", + Handler: _Msg_TimeoutOnClose_Handler, + }, + { + MethodName: "Acknowledgement", + Handler: _Msg_Acknowledgement_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/core/channel/v1/channel.proto", } func (m *MsgChannelOpenInit) Marshal() (dAtA []byte, err error) { @@ -1040,6 +1864,29 @@ func (m *MsgChannelOpenInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenInitResponse) 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 *MsgChannelOpenInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenTry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1125,6 +1972,29 @@ func (m *MsgChannelOpenTry) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenTryResponse) 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 *MsgChannelOpenTryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenAck) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1200,6 +2070,29 @@ func (m *MsgChannelOpenAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenAckResponse) 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 *MsgChannelOpenAckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenAckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelOpenConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1261,6 +2154,29 @@ func (m *MsgChannelOpenConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelOpenConfirmResponse) 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 *MsgChannelOpenConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelOpenConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelCloseInit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1305,6 +2221,29 @@ func (m *MsgChannelCloseInit) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgChannelCloseInitResponse) 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 *MsgChannelCloseInitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgChannelCloseConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1366,6 +2305,29 @@ func (m *MsgChannelCloseConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgChannelCloseConfirmResponse) 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 *MsgChannelCloseConfirmResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgChannelCloseConfirmResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgRecvPacket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1423,6 +2385,29 @@ func (m *MsgRecvPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgRecvPacketResponse) 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 *MsgRecvPacketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRecvPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTimeout) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1485,6 +2470,29 @@ func (m *MsgTimeout) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTimeoutResponse) 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 *MsgTimeoutResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgTimeoutOnClose) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1554,6 +2562,29 @@ func (m *MsgTimeoutOnClose) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgTimeoutOnCloseResponse) 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 *MsgTimeoutOnCloseResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTimeoutOnCloseResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgAcknowledgement) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1618,6 +2649,29 @@ func (m *MsgAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgAcknowledgementResponse) 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 *MsgAcknowledgementResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAcknowledgementResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *Channel) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2014,6 +3068,15 @@ func (m *MsgChannelOpenInit) Size() (n int) { return n } +func (m *MsgChannelOpenInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenTry) Size() (n int) { if m == nil { return 0 @@ -2051,6 +3114,15 @@ func (m *MsgChannelOpenTry) Size() (n int) { return n } +func (m *MsgChannelOpenTryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenAck) Size() (n int) { if m == nil { return 0 @@ -2086,6 +3158,15 @@ func (m *MsgChannelOpenAck) Size() (n int) { return n } +func (m *MsgChannelOpenAckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelOpenConfirm) Size() (n int) { if m == nil { return 0 @@ -2113,6 +3194,15 @@ func (m *MsgChannelOpenConfirm) Size() (n int) { return n } +func (m *MsgChannelOpenConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelCloseInit) Size() (n int) { if m == nil { return 0 @@ -2134,6 +3224,15 @@ func (m *MsgChannelCloseInit) Size() (n int) { return n } +func (m *MsgChannelCloseInitResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgChannelCloseConfirm) Size() (n int) { if m == nil { return 0 @@ -2161,6 +3260,15 @@ func (m *MsgChannelCloseConfirm) Size() (n int) { return n } +func (m *MsgChannelCloseConfirmResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgRecvPacket) Size() (n int) { if m == nil { return 0 @@ -2182,6 +3290,15 @@ func (m *MsgRecvPacket) Size() (n int) { return n } +func (m *MsgRecvPacketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTimeout) Size() (n int) { if m == nil { return 0 @@ -2206,6 +3323,15 @@ func (m *MsgTimeout) Size() (n int) { return n } +func (m *MsgTimeoutResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgTimeoutOnClose) Size() (n int) { if m == nil { return 0 @@ -2234,6 +3360,15 @@ func (m *MsgTimeoutOnClose) Size() (n int) { return n } +func (m *MsgTimeoutOnCloseResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgAcknowledgement) Size() (n int) { if m == nil { return 0 @@ -2259,6 +3394,15 @@ func (m *MsgAcknowledgement) Size() (n int) { return n } +func (m *MsgAcknowledgementResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *Channel) Size() (n int) { if m == nil { return 0 @@ -2622,6 +3766,59 @@ func (m *MsgChannelOpenInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenInitResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2935,6 +4132,59 @@ func (m *MsgChannelOpenTry) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenTryResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenTryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3215,6 +4465,59 @@ func (m *MsgChannelOpenAck) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenAckResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenAckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenAckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3431,6 +4734,59 @@ func (m *MsgChannelOpenConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelOpenConfirmResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelOpenConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelOpenConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3580,6 +4936,59 @@ func (m *MsgChannelCloseInit) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelCloseInitResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelCloseInitResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseInitResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3796,6 +5205,59 @@ func (m *MsgChannelCloseConfirm) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgChannelCloseConfirmResponse) 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 ErrIntOverflowChannel + } + 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: MsgChannelCloseConfirmResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgChannelCloseConfirmResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3981,6 +5443,59 @@ func (m *MsgRecvPacket) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgRecvPacketResponse) 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 ErrIntOverflowChannel + } + 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: MsgRecvPacketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRecvPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgTimeout) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4185,6 +5700,59 @@ func (m *MsgTimeout) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTimeoutResponse) 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 ErrIntOverflowChannel + } + 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: MsgTimeoutResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4423,6 +5991,59 @@ func (m *MsgTimeoutOnClose) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgTimeoutOnCloseResponse) 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 ErrIntOverflowChannel + } + 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: MsgTimeoutOnCloseResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTimeoutOnCloseResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4642,6 +6263,59 @@ func (m *MsgAcknowledgement) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAcknowledgementResponse) 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 ErrIntOverflowChannel + } + 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: MsgAcknowledgementResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAcknowledgementResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Channel) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ibc/core/genesis_test.go b/x/ibc/core/genesis_test.go index c5db6ae996df..1fbf41f6078e 100644 --- a/x/ibc/core/genesis_test.go +++ b/x/ibc/core/genesis_test.go @@ -2,7 +2,9 @@ package ibc_test import ( "fmt" + "testing" + "github.com/stretchr/testify/suite" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/codec" @@ -20,6 +22,42 @@ import ( ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" ) +const ( + connectionID = "connectionidone" + clientID = "clientidone" + connectionID2 = "connectionidtwo" + clientID2 = "clientidtwo" + + port1 = "firstport" + port2 = "secondport" + + channel1 = "firstchannel" + channel2 = "secondchannel" +) + +var clientHeight = clienttypes.NewHeight(0, 10) + +type IBCTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain +} + +// SetupTest creates a coordinator with 2 test chains. +func (suite *IBCTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) + + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) +} + +func TestIBCTestSuite(t *testing.T) { + suite.Run(t, new(IBCTestSuite)) +} + func (suite *IBCTestSuite) TestValidateGenesis() { testCases := []struct { name string diff --git a/x/ibc/core/handler.go b/x/ibc/core/handler.go index 3d3ea6280fd7..d2ef7f7b6159 100644 --- a/x/ibc/core/handler.go +++ b/x/ibc/core/handler.go @@ -1,17 +1,11 @@ package ibc import ( - "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" - client "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" - connection "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" - channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" - porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" ) @@ -23,340 +17,75 @@ func NewHandler(k keeper.Keeper) sdk.Handler { switch msg := msg.(type) { // IBC client msg interface types case *clienttypes.MsgCreateClient: - return client.HandleMsgCreateClient(ctx, k.ClientKeeper, msg) + res, err := k.CreateClient(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgUpdateClient: - return client.HandleMsgUpdateClient(ctx, k.ClientKeeper, msg) + res, err := k.UpdateClient(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *clienttypes.MsgSubmitMisbehaviour: - return client.HandleMsgSubmitMisbehaviour(ctx, k.ClientKeeper, msg) + res, err := k.SubmitMisbehaviour(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC connection msgs case *connectiontypes.MsgConnectionOpenInit: - return connection.HandleMsgConnectionOpenInit(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenTry: - return connection.HandleMsgConnectionOpenTry(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenTry(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenAck: - return connection.HandleMsgConnectionOpenAck(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenAck(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *connectiontypes.MsgConnectionOpenConfirm: - return connection.HandleMsgConnectionOpenConfirm(ctx, k.ConnectionKeeper, msg) + res, err := k.ConnectionOpenConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC channel msgs case *channeltypes.MsgChannelOpenInit: - // Lookup module by port capability - module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - res, cap, err := channel.HandleMsgChannelOpenInit(ctx, k.ChannelKeeper, portCap, msg) - if err != nil { - return nil, err - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version); err != nil { - return nil, sdkerrors.Wrap(err, "channel open init callback failed") - } - - return res, nil + res, err := k.ChannelOpenInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenTry: - // Lookup module by port capability - module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - res, cap, err := channel.HandleMsgChannelOpenTry(ctx, k.ChannelKeeper, portCap, msg) - if err != nil { - return nil, err - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.DesiredChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion); err != nil { - return nil, sdkerrors.Wrap(err, "channel open try callback failed") - } - - return res, nil + res, err := k.ChannelOpenTry(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenAck: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil { - return nil, sdkerrors.Wrap(err, "channel open ack callback failed") - } - - return channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelOpenAck(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelOpenConfirm: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel open confirm callback failed") - } - - return channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelOpenConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseInit: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel close init callback failed") - } - - return channel.HandleMsgChannelCloseInit(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelCloseInit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgChannelCloseConfirm: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { - return nil, sdkerrors.Wrap(err, "channel close confirm callback failed") - } - - return channel.HandleMsgChannelCloseConfirm(ctx, k.ChannelKeeper, cap, msg) + res, err := k.ChannelCloseConfirm(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // IBC packet msgs get routed to the appropriate module callback case *channeltypes.MsgRecvPacket: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.RecvPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight); err != nil { - return nil, sdkerrors.Wrap(err, "receive packet verification failed") - } - - // Perform application logic callback - res, ack, err := cbs.OnRecvPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "receive packet callback failed") - } - - if err := k.ChannelKeeper.WriteReceipt(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - // Set packet acknowledgement only if the acknowledgement is not nil. - // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the - // acknowledgement is nil. - if ack != nil { - if err := k.ChannelKeeper.WriteAcknowledgement(ctx, msg.Packet, ack); err != nil { - return nil, err - } - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - }, - ) - }() - - return res, nil + res, err := k.RecvPacket(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgAcknowledgement: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.AcknowledgePacket(ctx, msg.Packet, msg.Acknowledgement, msg.Proof, msg.ProofHeight); err != nil { - return nil, sdkerrors.Wrap(err, "acknowledge packet verification failed") - } - - // Perform application logic callback - res, err := cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement) - if err != nil { - return nil, sdkerrors.Wrap(err, "acknowledge packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.AcknowledgementExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"tx", "msg", "ibc", msg.Type()}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - }, - ) - }() - - return res, nil + res, err := k.Acknowledgement(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeout: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.TimeoutPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight, msg.NextSequenceRecv); err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet verification failed") - } - - // Perform application logic callback - res, err := cbs.OnTimeoutPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"ibc", "timeout", "packet"}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - telemetry.NewLabel("timeout-type", "height"), - }, - ) - }() - - return res, nil + res, err := k.Timeout(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) case *channeltypes.MsgTimeoutOnClose: - // Lookup module by channel capability - module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) - if err != nil { - return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") - } - - // Retrieve callbacks from router - cbs, ok := k.Router.GetRoute(module) - if !ok { - return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) - } - - // Perform TAO verification - if err := k.ChannelKeeper.TimeoutOnClose(ctx, cap, msg.Packet, msg.Proof, msg.ProofClose, msg.ProofHeight, msg.NextSequenceRecv); err != nil { - return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed") - } - - // Perform application logic callback - // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" - // application logic callback. - res, err := cbs.OnTimeoutPacket(ctx, msg.Packet) - if err != nil { - return nil, sdkerrors.Wrap(err, "timeout packet callback failed") - } - - // Delete packet commitment - if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { - return nil, err - } - - defer func() { - telemetry.IncrCounterWithLabels( - []string{"ibc", "timeout", "packet"}, - 1, - []metrics.Label{ - telemetry.NewLabel("source-port", msg.Packet.SourcePort), - telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), - telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), - telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), - telemetry.NewLabel("timeout-type", "channel-closed"), - }, - ) - }() - - return res, nil + res, err := k.TimeoutOnClose(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) default: return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized IBC message type: %T", msg) diff --git a/x/ibc/core/keeper/msg_server.go b/x/ibc/core/keeper/msg_server.go new file mode 100644 index 000000000000..15af7348462e --- /dev/null +++ b/x/ibc/core/keeper/msg_server.go @@ -0,0 +1,622 @@ +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" + clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" + connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types" + channel "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel" + channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" + porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" +) + +var _ clienttypes.MsgServer = Keeper{} +var _ connectiontypes.MsgServer = Keeper{} +var _ channeltypes.MsgServer = Keeper{} + +// CreateClient defines a rpc handler method for MsgCreateClient. +func (k Keeper) CreateClient(goCtx context.Context, msg *clienttypes.MsgCreateClient) (*clienttypes.MsgCreateClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + clientState, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, err + } + + consensusState, err := clienttypes.UnpackConsensusState(msg.ConsensusState) + if err != nil { + return nil, err + } + + if err = k.ClientKeeper.CreateClient(ctx, msg.ClientId, clientState, consensusState); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + clienttypes.EventTypeCreateClient, + sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(clienttypes.AttributeKeyClientType, clientState.ClientType()), + sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + }) + + return &clienttypes.MsgCreateClientResponse{}, nil +} + +// UpdateClient defines a rpc handler method for MsgUpdateClient. +func (k Keeper) UpdateClient(goCtx context.Context, msg *clienttypes.MsgUpdateClient) (*clienttypes.MsgUpdateClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + header, err := clienttypes.UnpackHeader(msg.Header) + if err != nil { + return nil, err + } + + if err = k.ClientKeeper.UpdateClient(ctx, msg.ClientId, header); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + ) + + return &clienttypes.MsgUpdateClientResponse{}, nil +} + +// UpgradeClient defines a rpc handler method for MsgUpgradeClient. +func (k Keeper) UpgradeClient(goCtx context.Context, msg *clienttypes.MsgUpgradeClient) (*clienttypes.MsgUpgradeClientResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + upgradedClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, err + } + + if err := upgradedClient.Validate(); err != nil { + return nil, err + } + + if err = k.ClientKeeper.UpgradeClient(ctx, msg.ClientId, upgradedClient, msg.UpgradeHeight, msg.ProofUpgrade); err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, clienttypes.AttributeValueCategory), + ), + ) + + return &clienttypes.MsgUpgradeClientResponse{}, nil +} + +// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. +func (k Keeper) SubmitMisbehaviour(goCtx context.Context, msg *clienttypes.MsgSubmitMisbehaviour) (*clienttypes.MsgSubmitMisbehaviourResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + misbehaviour, err := clienttypes.UnpackMisbehaviour(msg.Misbehaviour) + if err != nil { + return nil, err + } + + if err := k.ClientKeeper.CheckMisbehaviourAndUpdateState(ctx, misbehaviour); err != nil { + return nil, sdkerrors.Wrap(err, "failed to process misbehaviour for IBC client") + } + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + clienttypes.EventTypeSubmitMisbehaviour, + sdk.NewAttribute(clienttypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(clienttypes.AttributeKeyClientType, misbehaviour.ClientType()), + sdk.NewAttribute(clienttypes.AttributeKeyConsensusHeight, misbehaviour.GetHeight().String()), + ), + ) + + return &clienttypes.MsgSubmitMisbehaviourResponse{}, nil +} + +// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. +func (k Keeper) ConnectionOpenInit(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenInit) (*connectiontypes.MsgConnectionOpenInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.ConnectionKeeper.ConnOpenInit( + ctx, msg.ConnectionId, msg.ClientId, msg.Counterparty, msg.Version, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open init failed") + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenInit, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenInitResponse{}, nil +} + +// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. +func (k Keeper) ConnectionOpenTry(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenTry) (*connectiontypes.MsgConnectionOpenTryResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + targetClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v.", targetClient) + } + + if err := k.ConnectionKeeper.ConnOpenTry( + ctx, msg.DesiredConnectionId, msg.CounterpartyChosenConnectionId, msg.Counterparty, msg.ClientId, targetClient, + msg.CounterpartyVersions, msg.ProofInit, msg.ProofClient, msg.ProofConsensus, + msg.ProofHeight, msg.ConsensusHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open try failed") + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenTry, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.DesiredConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, msg.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, msg.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, msg.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenTryResponse{}, nil +} + +// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. +func (k Keeper) ConnectionOpenAck(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenAck) (*connectiontypes.MsgConnectionOpenAckResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + targetClient, err := clienttypes.UnpackClientState(msg.ClientState) + if err != nil { + return nil, sdkerrors.Wrapf(err, "client in msg is not exported.ClientState. invalid client: %v", targetClient) + } + + if err := k.ConnectionKeeper.ConnOpenAck( + ctx, msg.ConnectionId, targetClient, msg.Version, msg.CounterpartyConnectionId, + msg.ProofTry, msg.ProofClient, msg.ProofConsensus, + msg.ProofHeight, msg.ConsensusHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open ack failed") + } + + connectionEnd, _ := k.ConnectionKeeper.GetConnection(ctx, msg.ConnectionId) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenAck, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, connectionEnd.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenAckResponse{}, nil +} + +// ConnectionOpenConfirm defines a rpc handler method for MsgConnectionOpenConfirm. +func (k Keeper) ConnectionOpenConfirm(goCtx context.Context, msg *connectiontypes.MsgConnectionOpenConfirm) (*connectiontypes.MsgConnectionOpenConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if err := k.ConnectionKeeper.ConnOpenConfirm( + ctx, msg.ConnectionId, msg.ProofAck, msg.ProofHeight, + ); err != nil { + return nil, sdkerrors.Wrap(err, "connection handshake open confirm failed") + } + + connectionEnd, _ := k.ConnectionKeeper.GetConnection(ctx, msg.ConnectionId) + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + connectiontypes.EventTypeConnectionOpenConfirm, + sdk.NewAttribute(connectiontypes.AttributeKeyConnectionID, msg.ConnectionId), + sdk.NewAttribute(connectiontypes.AttributeKeyClientID, connectionEnd.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyClientID, connectionEnd.Counterparty.ClientId), + sdk.NewAttribute(connectiontypes.AttributeKeyCounterpartyConnectionID, connectionEnd.Counterparty.ConnectionId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, connectiontypes.AttributeValueCategory), + ), + }) + + return &connectiontypes.MsgConnectionOpenConfirmResponse{}, nil +} + +// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. +func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChannelOpenInit) (*channeltypes.MsgChannelOpenInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by port capability + module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + _, cap, err := channel.HandleMsgChannelOpenInit(ctx, k.ChannelKeeper, portCap, msg) + if err != nil { + return nil, err + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenInit(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.ChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version); err != nil { + return nil, sdkerrors.Wrap(err, "channel open init callback failed") + } + + return &channeltypes.MsgChannelOpenInitResponse{}, nil +} + +// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. +func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChannelOpenTry) (*channeltypes.MsgChannelOpenTryResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by port capability + module, portCap, err := k.PortKeeper.LookupModuleByPort(ctx, msg.PortId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + _, cap, err := channel.HandleMsgChannelOpenTry(ctx, k.ChannelKeeper, portCap, msg) + if err != nil { + return nil, err + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenTry(ctx, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.PortId, msg.DesiredChannelId, cap, msg.Channel.Counterparty, msg.Channel.Version, msg.CounterpartyVersion); err != nil { + return nil, sdkerrors.Wrap(err, "channel open try callback failed") + } + + return &channeltypes.MsgChannelOpenTryResponse{}, nil +} + +// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. +func (k Keeper) ChannelOpenAck(goCtx context.Context, msg *channeltypes.MsgChannelOpenAck) (*channeltypes.MsgChannelOpenAckResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenAck(ctx, msg.PortId, msg.ChannelId, msg.CounterpartyVersion); err != nil { + return nil, sdkerrors.Wrap(err, "channel open ack callback failed") + } + + _, err = channel.HandleMsgChannelOpenAck(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelOpenAckResponse{}, nil +} + +// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. +func (k Keeper) ChannelOpenConfirm(goCtx context.Context, msg *channeltypes.MsgChannelOpenConfirm) (*channeltypes.MsgChannelOpenConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanOpenConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel open confirm callback failed") + } + + _, err = channel.HandleMsgChannelOpenConfirm(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelOpenConfirmResponse{}, nil +} + +// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. +func (k Keeper) ChannelCloseInit(goCtx context.Context, msg *channeltypes.MsgChannelCloseInit) (*channeltypes.MsgChannelCloseInitResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanCloseInit(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel close init callback failed") + } + + _, err = channel.HandleMsgChannelCloseInit(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelCloseInitResponse{}, nil +} + +// ChannelCloseConfirm defines a rpc handler method for MsgChannelCloseConfirm. +func (k Keeper) ChannelCloseConfirm(goCtx context.Context, msg *channeltypes.MsgChannelCloseConfirm) (*channeltypes.MsgChannelCloseConfirmResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.PortId, msg.ChannelId) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + if err = cbs.OnChanCloseConfirm(ctx, msg.PortId, msg.ChannelId); err != nil { + return nil, sdkerrors.Wrap(err, "channel close confirm callback failed") + } + + _, err = channel.HandleMsgChannelCloseConfirm(ctx, k.ChannelKeeper, cap, msg) + if err != nil { + return nil, err + } + + return &channeltypes.MsgChannelCloseConfirmResponse{}, nil +} + +// RecvPacket defines a rpc handler method for MsgRecvPacket. +func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacket) (*channeltypes.MsgRecvPacketResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.RecvPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight); err != nil { + return nil, sdkerrors.Wrap(err, "receive packet verification failed") + } + + // Perform application logic callback + _, ack, err := cbs.OnRecvPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "receive packet callback failed") + } + + if err := k.ChannelKeeper.WriteReceipt(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + // Set packet acknowledgement only if the acknowledgement is not nil. + // NOTE: IBC applications modules may call the WriteAcknowledgement asynchronously if the + // acknowledgement is nil. + if ack != nil { + if err := k.ChannelKeeper.WriteAcknowledgement(ctx, msg.Packet, ack); err != nil { + return nil, err + } + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"tx", "msg", "ibc", msg.Type()}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + }, + ) + }() + + return &channeltypes.MsgRecvPacketResponse{}, nil +} + +// Timeout defines a rpc handler method for MsgTimeout. +func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*channeltypes.MsgTimeoutResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.TimeoutPacket(ctx, msg.Packet, msg.Proof, msg.ProofHeight, msg.NextSequenceRecv); err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet verification failed") + } + + // Perform application logic callback + _, err = cbs.OnTimeoutPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"ibc", "timeout", "packet"}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + telemetry.NewLabel("timeout-type", "height"), + }, + ) + }() + + return &channeltypes.MsgTimeoutResponse{}, nil +} + +// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. +func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeoutOnClose) (*channeltypes.MsgTimeoutOnCloseResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.TimeoutOnClose(ctx, cap, msg.Packet, msg.Proof, msg.ProofClose, msg.ProofHeight, msg.NextSequenceRecv); err != nil { + return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed") + } + + // Perform application logic callback + // NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket" + // application logic callback. + _, err = cbs.OnTimeoutPacket(ctx, msg.Packet) + if err != nil { + return nil, sdkerrors.Wrap(err, "timeout packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"ibc", "timeout", "packet"}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + telemetry.NewLabel("timeout-type", "channel-closed"), + }, + ) + }() + + return &channeltypes.MsgTimeoutOnCloseResponse{}, nil +} + +// Acknowledgement defines a rpc handler method for MsgAcknowledgement. +func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAcknowledgement) (*channeltypes.MsgAcknowledgementResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Lookup module by channel capability + module, cap, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.SourcePort, msg.Packet.SourceChannel) + if err != nil { + return nil, sdkerrors.Wrap(err, "could not retrieve module from port-id") + } + + // Retrieve callbacks from router + cbs, ok := k.Router.GetRoute(module) + if !ok { + return nil, sdkerrors.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module) + } + + // Perform TAO verification + if err := k.ChannelKeeper.AcknowledgePacket(ctx, msg.Packet, msg.Acknowledgement, msg.Proof, msg.ProofHeight); err != nil { + return nil, sdkerrors.Wrap(err, "acknowledge packet verification failed") + } + + // Perform application logic callback + _, err = cbs.OnAcknowledgementPacket(ctx, msg.Packet, msg.Acknowledgement) + if err != nil { + return nil, sdkerrors.Wrap(err, "acknowledge packet callback failed") + } + + // Delete packet commitment + if err = k.ChannelKeeper.AcknowledgementExecuted(ctx, cap, msg.Packet); err != nil { + return nil, err + } + + defer func() { + telemetry.IncrCounterWithLabels( + []string{"tx", "msg", "ibc", msg.Type()}, + 1, + []metrics.Label{ + telemetry.NewLabel("source-port", msg.Packet.SourcePort), + telemetry.NewLabel("source-channel", msg.Packet.SourceChannel), + telemetry.NewLabel("destination-port", msg.Packet.DestinationPort), + telemetry.NewLabel("destination-channel", msg.Packet.DestinationChannel), + }, + ) + }() + + return &channeltypes.MsgAcknowledgementResponse{}, nil +} diff --git a/x/ibc/core/handler_test.go b/x/ibc/core/keeper/msg_server_test.go similarity index 76% rename from x/ibc/core/handler_test.go rename to x/ibc/core/keeper/msg_server_test.go index 4616a726b660..a41ed18b13a3 100644 --- a/x/ibc/core/handler_test.go +++ b/x/ibc/core/keeper/msg_server_test.go @@ -1,23 +1,31 @@ -package ibc_test +package keeper_test import ( "testing" + "time" "github.com/stretchr/testify/suite" - ibc "github.com/cosmos/cosmos-sdk/x/ibc/core" + sdk "github.com/cosmos/cosmos-sdk/types" clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types" + commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host" + "github.com/cosmos/cosmos-sdk/x/ibc/core/exported" + "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types" ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) +const height = 10 + var ( timeoutHeight = clienttypes.NewHeight(0, 10000) maxSequence = uint64(10) ) -type HandlerTestSuite struct { +type KeeperTestSuite struct { suite.Suite coordinator *ibctesting.Coordinator @@ -27,14 +35,14 @@ type HandlerTestSuite struct { } // SetupTest creates a coordinator with 2 test chains. -func (suite *HandlerTestSuite) SetupTest() { +func (suite *KeeperTestSuite) SetupTest() { suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) } -func TestHandlerTestSuite(t *testing.T) { - suite.Run(t, new(HandlerTestSuite)) +func TestIBCTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) } // tests the IBC handler receiving a packet on ordered and unordered channels. @@ -42,7 +50,7 @@ func TestHandlerTestSuite(t *testing.T) { // tests high level properties like ordering and basic sanity checks. More // rigorous testing of 'RecvPacket' and 'WriteReceipt' can be found in the // 04-channel/keeper/packet_test.go. -func (suite *HandlerTestSuite) TestHandleRecvPacket() { +func (suite *KeeperTestSuite) TestHandleRecvPacket() { var ( packet channeltypes.Packet ) @@ -126,8 +134,6 @@ func (suite *HandlerTestSuite) TestHandleRecvPacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainB.App.IBCKeeper) - tc.malleate() // get proof of packet commitment from chainA @@ -137,13 +143,13 @@ func (suite *HandlerTestSuite) TestHandleRecvPacket() { msg := channeltypes.NewMsgRecvPacket(packet, proof, proofHeight, suite.chainB.SenderAccount.GetAddress()) // ante-handle RecvPacket - _, err := handler(suite.chainB.GetContext(), msg) + _, err := keeper.Keeper.RecvPacket(*suite.chainB.App.IBCKeeper, sdk.WrapSDKContext(suite.chainB.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should fail since state changes occur - _, err := handler(suite.chainB.GetContext(), msg) + _, err := keeper.Keeper.RecvPacket(*suite.chainB.App.IBCKeeper, sdk.WrapSDKContext(suite.chainB.GetContext()), msg) suite.Require().Error(err) // verify ack was written @@ -162,7 +168,7 @@ func (suite *HandlerTestSuite) TestHandleRecvPacket() { // occurs. It test high level properties like ordering and basic sanity // checks. More rigorous testing of 'AcknowledgePacket' and 'AcknowledgementExecuted' // can be found in the 04-channel/keeper/packet_test.go. -func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { +func (suite *KeeperTestSuite) TestHandleAcknowledgePacket() { var ( packet channeltypes.Packet ) @@ -286,8 +292,6 @@ func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { suite.SetupTest() // reset ibctesting.TestHash = ibctesting.MockAcknowledgement - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() packetKey := host.KeyPacketAcknowledgement(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) @@ -295,13 +299,13 @@ func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { msg := channeltypes.NewMsgAcknowledgement(packet, ibctesting.MockAcknowledgement, proof, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Acknowledgement(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Acknowledgement(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -320,7 +324,7 @@ func (suite *HandlerTestSuite) TestHandleAcknowledgePacket() { // high level properties like ordering and basic sanity checks. More // rigorous testing of 'TimeoutPacket' and 'TimeoutExecuted' can be found in // the 04-channel/keeper/timeout_test.go. -func (suite *HandlerTestSuite) TestHandleTimeoutPacket() { +func (suite *KeeperTestSuite) TestHandleTimeoutPacket() { var ( packet channeltypes.Packet packetKey []byte @@ -410,21 +414,19 @@ func (suite *HandlerTestSuite) TestHandleTimeoutPacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() proof, proofHeight := suite.chainB.QueryProof(packetKey) msg := channeltypes.NewMsgTimeout(packet, 1, proof, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Timeout(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should return an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.Timeout(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -443,7 +445,7 @@ func (suite *HandlerTestSuite) TestHandleTimeoutPacket() { // commitment occurs. It tests high level properties like ordering and basic // sanity checks. More rigorous testing of 'TimeoutOnClose' and //'TimeoutExecuted' can be found in the 04-channel/keeper/timeout_test.go. -func (suite *HandlerTestSuite) TestHandleTimeoutOnClosePacket() { +func (suite *KeeperTestSuite) TestHandleTimeoutOnClosePacket() { var ( packet channeltypes.Packet packetKey []byte @@ -591,8 +593,6 @@ func (suite *HandlerTestSuite) TestHandleTimeoutOnClosePacket() { suite.Run(tc.name, func() { suite.SetupTest() // reset - handler := ibc.NewHandler(*suite.chainA.App.IBCKeeper) - tc.malleate() proof, proofHeight := suite.chainB.QueryProof(packetKey) @@ -602,13 +602,13 @@ func (suite *HandlerTestSuite) TestHandleTimeoutOnClosePacket() { msg := channeltypes.NewMsgTimeoutOnClose(packet, 1, proof, proofClosed, proofHeight, suite.chainA.SenderAccount.GetAddress()) - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.TimeoutOnClose(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) if tc.expPass { suite.Require().NoError(err) // replay should return an error - _, err := handler(suite.chainA.GetContext(), msg) + _, err := keeper.Keeper.TimeoutOnClose(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) suite.Require().Error(err) // verify packet commitment was deleted on source chain @@ -621,3 +621,140 @@ func (suite *HandlerTestSuite) TestHandleTimeoutOnClosePacket() { }) } } + +func (suite *KeeperTestSuite) TestUpgradeClient() { + var ( + clientA string + upgradedClient exported.ClientState + upgradeHeight exported.Height + msg *clienttypes.MsgUpgradeClient + ) + + newClientHeight := clienttypes.NewHeight(1, 1) + + cases := []struct { + name string + setup func() + expPass bool + }{ + { + name: "successful upgrade", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: true, + }, + { + name: "invalid upgrade: msg.ClientState does not contain valid clientstate", + setup: func() { + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + consState := ibctmtypes.NewConsensusState(time.Now(), commitmenttypes.NewMerkleRoot([]byte("app_hash")), []byte("next_vals_hash")) + consAny, err := clienttypes.PackConsensusState(consState) + suite.Require().NoError(err) + + height, _ := upgradeHeight.(clienttypes.Height) + + msg = &clienttypes.MsgUpgradeClient{ClientId: clientA, ClientState: consAny, UpgradeHeight: &height, ProofUpgrade: proofUpgrade, Signer: suite.chainA.SenderAccount.GetAddress().String()} + }, + expPass: false, + }, + { + name: "invalid clientstate", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + cs, found := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(found) + + proofUpgrade, _ := suite.chainB.QueryUpgradeProof(upgradetypes.UpgradedClientKey(int64(upgradeHeight.GetVersionHeight())), cs.GetLatestHeight().GetVersionHeight()) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, proofUpgrade, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: false, + }, + { + name: "VerifyUpgrade fails", + setup: func() { + + upgradedClient = ibctmtypes.NewClientState("newChainId", ibctmtypes.DefaultTrustLevel, ibctesting.TrustingPeriod, ibctesting.UnbondingPeriod+ibctesting.TrustingPeriod, ibctesting.MaxClockDrift, newClientHeight, ibctesting.DefaultConsensusParams, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, false, false) + + // upgrade Height is at next block + upgradeHeight = clienttypes.NewHeight(0, uint64(suite.chainB.GetContext().BlockHeight()+1)) + + // zero custom fields and store in upgrade store + suite.chainB.App.UpgradeKeeper.SetUpgradedClient(suite.chainB.GetContext(), int64(upgradeHeight.GetVersionHeight()), upgradedClient) + + // commit upgrade store changes and update clients + + suite.coordinator.CommitBlock(suite.chainB) + err := suite.coordinator.UpdateClient(suite.chainA, suite.chainB, clientA, ibctesting.Tendermint) + suite.Require().NoError(err) + + msg, err = clienttypes.NewMsgUpgradeClient(clientA, upgradedClient, upgradeHeight, nil, suite.chainA.SenderAccount.GetAddress()) + suite.Require().NoError(err) + }, + expPass: false, + }, + } + + for _, tc := range cases { + tc := tc + clientA, _ = suite.coordinator.SetupClients(suite.chainA, suite.chainB, ibctesting.Tendermint) + + tc.setup() + + _, err := keeper.Keeper.UpgradeClient(*suite.chainA.App.IBCKeeper, sdk.WrapSDKContext(suite.chainA.GetContext()), msg) + + if tc.expPass { + suite.Require().NoError(err, "upgrade handler failed on valid case: %s", tc.name) + newClient, ok := suite.chainA.App.IBCKeeper.ClientKeeper.GetClientState(suite.chainA.GetContext(), clientA) + suite.Require().True(ok) + suite.Require().Equal(upgradedClient, newClient) + } else { + suite.Require().Error(err, "upgrade handler passed on invalid case: %s", tc.name) + } + } +} diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 35a734ccf959..4590556be95a 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -130,8 +130,11 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return nil } -// RegisterQueryService registers the gRPC query service for the ibc module. +// RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { + clienttypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) + connectiontypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) + channeltypes.RegisterMsgServer(cfg.MsgServer(), am.keeper) types.RegisterQueryService(cfg.QueryServer(), am.keeper) } From 7cd74928034bebf485a4911734fbf84308ab9d08 Mon Sep 17 00:00:00 2001 From: Cory Levinson Date: Mon, 19 Oct 2020 17:24:59 -0700 Subject: [PATCH 12/12] add changelog entries for non-nil Result.Data fields in message responses --- CHANGELOG.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ce77a5d26e3..4cc94213e92a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,8 +39,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Client Breaking Changes * __Modules__ - * (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`. - * (x/evidence) [\#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field of `MsgSubmitEvidence` does not contain the raw evidence's hash, but the encoded `MsgSubmitEvidenceResponse` struct. + * (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`. + * (x/staking) [\#7556](https://github.com/cosmos/cosmos-sdk/pull/7556) The ABCI's `Result.Data` field for + `MsgBeginRedelegate` and `MsgUndelegate` responses does not contain custom binary marshaled `completionTime`, but the + protobuf encoded `MsgBeginRedelegateResponse` and `MsgUndelegateResponse` structs respectively + * (x/evidence) [\#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field for + `MsgSubmitEvidence` responses does not contain the raw evidence's hash, but the protobuf encoded + `MsgSubmitEvidenceResponse` struct. + * (x/gov) [\#7533](https://github.com/cosmos/cosmos-sdk/pull/7533) The ABCI's `Result.Data` field for + `MsgSubmitProposal` responses does not contain a raw binary encoding of the `proposalID`, but the protobuf encoded + `MsgSubmitSubmitProposalResponse` struct. ### API Breaking