diff --git a/proto/palomachain/paloma/paloma/genesis.proto b/proto/palomachain/paloma/paloma/genesis.proto index b164884f..85dd1f64 100644 --- a/proto/palomachain/paloma/paloma/genesis.proto +++ b/proto/palomachain/paloma/paloma/genesis.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package palomachain.paloma.paloma; import "gogoproto/gogo.proto"; +import "palomachain/paloma/paloma/light_node_client.proto"; import "palomachain/paloma/paloma/light_node_client_feegranter.proto"; import "palomachain/paloma/paloma/light_node_client_funders.proto"; import "palomachain/paloma/paloma/light_node_client_license.proto"; @@ -15,4 +16,5 @@ message GenesisState { repeated LightNodeClientLicense light_node_client_licenses = 2; LightNodeClientFeegranter light_node_client_feegranter = 3; LightNodeClientFunders light_node_client_funders = 4; + repeated LightNodeClient light_node_clients = 5; } diff --git a/proto/palomachain/paloma/paloma/light_node_client.proto b/proto/palomachain/paloma/paloma/light_node_client.proto new file mode 100644 index 00000000..af697900 --- /dev/null +++ b/proto/palomachain/paloma/paloma/light_node_client.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package palomachain.paloma.paloma; + +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/palomachain/paloma/v2/x/paloma/types"; + +message LightNodeClient { + string client_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + google.protobuf.Timestamp activated_at = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + google.protobuf.Timestamp last_auth_at = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; +} diff --git a/proto/palomachain/paloma/paloma/query.proto b/proto/palomachain/paloma/paloma/query.proto index 3aa71e2d..57102c37 100644 --- a/proto/palomachain/paloma/paloma/query.proto +++ b/proto/palomachain/paloma/paloma/query.proto @@ -5,6 +5,7 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; +import "palomachain/paloma/paloma/light_node_client.proto"; import "palomachain/paloma/paloma/light_node_client_feegranter.proto"; import "palomachain/paloma/paloma/light_node_client_funders.proto"; import "palomachain/paloma/paloma/light_node_client_license.proto"; @@ -34,7 +35,13 @@ service Query { rpc GetLightNodeClientFunders(google.protobuf.Empty) returns (QueryLightNodeClientFundersResponse) { option (google.api.http).get = - "/palomachain/paloma/paloma/light_node_client_funder"; + "/palomachain/paloma/paloma/light_node_client_funders"; + } + + rpc GetLightNodeClients(google.protobuf.Empty) + returns (QueryLightNodeClientsResponse) { + option (google.api.http).get = + "/palomachain/paloma/paloma/light_node_clients"; } } @@ -59,3 +66,7 @@ message QueryLightNodeClientFeegranterResponse { message QueryLightNodeClientFundersResponse { LightNodeClientFunders light_node_client_funders = 1; } + +message QueryLightNodeClientsResponse { + repeated LightNodeClient light_node_clients = 1; +} diff --git a/proto/palomachain/paloma/paloma/tx.proto b/proto/palomachain/paloma/paloma/tx.proto index 95e75207..46ef4fc5 100644 --- a/proto/palomachain/paloma/paloma/tx.proto +++ b/proto/palomachain/paloma/paloma/tx.proto @@ -17,6 +17,12 @@ service Msg { rpc AddLightNodeClientLicense(MsgAddLightNodeClientLicense) returns (EmptyResponse); + + rpc AuthLightNodeClient(MsgAuthLightNodeClient) + returns (EmptyResponse); + + rpc SetLegacyLightNodeClients(MsgSetLegacyLightNodeClients) + returns (EmptyResponse); } message MsgAddStatusUpdate { @@ -57,3 +63,15 @@ message MsgAddLightNodeClientLicense { cosmos.base.v1beta1.Coin amount = 3 [ (gogoproto.nullable) = false ]; uint32 vesting_months = 4; } + +message MsgAuthLightNodeClient { + option (cosmos.msg.v1.signer) = "metadata"; + palomachain.paloma.valset.MsgMetadata metadata = 1 + [ (gogoproto.nullable) = false ]; +} + +message MsgSetLegacyLightNodeClients { + option (cosmos.msg.v1.signer) = "metadata"; + palomachain.paloma.valset.MsgMetadata metadata = 1 + [ (gogoproto.nullable) = false ]; +} diff --git a/x/paloma/client/cli/query.go b/x/paloma/client/cli/query.go index b8dd2a67..127b389c 100644 --- a/x/paloma/client/cli/query.go +++ b/x/paloma/client/cli/query.go @@ -23,6 +23,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryLightNodeClientFeegranter()) cmd.AddCommand(CmdQueryLightNodeClientLicenses()) cmd.AddCommand(CmdQueryLightNodeClientFunders()) + cmd.AddCommand(CmdQueryLightNodeClients()) return cmd } diff --git a/x/paloma/client/cli/query_light_node_clients.go b/x/paloma/client/cli/query_light_node_clients.go new file mode 100644 index 00000000..4e73114b --- /dev/null +++ b/x/paloma/client/cli/query_light_node_clients.go @@ -0,0 +1,37 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/palomachain/paloma/v2/x/paloma/types" + "github.com/spf13/cobra" + "google.golang.org/protobuf/types/known/emptypb" +) + +func CmdQueryLightNodeClients() *cobra.Command { + cmd := &cobra.Command{ + Use: "light-node-clients", + Short: "Shows information about all activated lightnode clients", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + params := &emptypb.Empty{} + res, err := queryClient.GetLightNodeClients( + context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/paloma/client/cli/tx.go b/x/paloma/client/cli/tx.go index fc3fd216..92094633 100644 --- a/x/paloma/client/cli/tx.go +++ b/x/paloma/client/cli/tx.go @@ -29,6 +29,8 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdRegisterLightNodeClient()) cmd.AddCommand(CmdAddLightNodeClientLicense()) + cmd.AddCommand(CmdAuthLightNodeClient()) + cmd.AddCommand(CmdSetLegacyLightNodeClients()) return cmd } @@ -125,3 +127,69 @@ The [vesting-months] parameter determines how long the funds will take to fully return cmd } + +func CmdAuthLightNodeClient() *cobra.Command { + cmd := &cobra.Command{ + Use: "auth-light-node-client", + Short: "Authenticate the lightnode using the `from` address", + Long: "Authenticate the lightnode using the `from` address", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + creator := clientCtx.GetFromAddress().String() + msg := &types.MsgAuthLightNodeClient{ + Metadata: valsettypes.MsgMetadata{ + Creator: creator, + Signers: []string{creator}, + }, + } + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func CmdSetLegacyLightNodeClients() *cobra.Command { + cmd := &cobra.Command{ + Use: "set-legacy-light-node-clients", + Short: "Set the legacy lightnode client addresses from feegranter", + Long: "Set the legacy lightnode client addresses from feegranter", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + creator := clientCtx.GetFromAddress().String() + msg := &types.MsgSetLegacyLightNodeClients{ + Metadata: valsettypes.MsgMetadata{ + Creator: creator, + Signers: []string{creator}, + }, + } + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/paloma/genesis.go b/x/paloma/genesis.go index a4328a5d..a6e8a4ee 100644 --- a/x/paloma/genesis.go +++ b/x/paloma/genesis.go @@ -36,6 +36,13 @@ func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisSta panic(err) } } + + for _, client := range genState.LightNodeClients { + err := k.SetLightNodeClient(ctx, client.ClientAddress, client) + if err != nil { + panic(err) + } + } } // ExportGenesis returns the capability module's exported genesis. @@ -60,5 +67,10 @@ func ExportGenesis(ctx context.Context, k keeper.Keeper) *types.GenesisState { panic(err) } + genesis.LightNodeClients, err = k.AllLightNodeClients(ctx) + if err != nil { + panic(err) + } + return genesis } diff --git a/x/paloma/genesis_test.go b/x/paloma/genesis_test.go index a4c58121..c361a0dc 100644 --- a/x/paloma/genesis_test.go +++ b/x/paloma/genesis_test.go @@ -2,6 +2,7 @@ package paloma_test import ( "testing" + "time" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" @@ -91,4 +92,23 @@ func TestGenesis(t *testing.T) { require.Equal(t, genesisState.LightNodeClientFunders.Accounts, got.LightNodeClientFunders.Accounts) }) + + t.Run("With light node clients", func(t *testing.T) { + genesisState := types.GenesisState{ + LightNodeClients: []*types.LightNodeClient{ + { + ClientAddress: clientAddr, + ActivatedAt: time.Now().UTC(), + LastAuthAt: time.Now().UTC(), + }, + }, + } + + k, ctx := keepertest.PalomaKeeper(t) + paloma.InitGenesis(ctx, *k, genesisState) + got := paloma.ExportGenesis(ctx, *k) + require.NotNil(t, got) + + require.Equal(t, genesisState.LightNodeClients, got.LightNodeClients) + }) } diff --git a/x/paloma/keeper/grpc_query_light_node_clients.go b/x/paloma/keeper/grpc_query_light_node_clients.go new file mode 100644 index 00000000..ebbd15c4 --- /dev/null +++ b/x/paloma/keeper/grpc_query_light_node_clients.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/v2/x/paloma/types" + "google.golang.org/protobuf/types/known/emptypb" +) + +func (k Keeper) GetLightNodeClients( + c context.Context, + _ *emptypb.Empty, +) (*types.QueryLightNodeClientsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + clients, err := k.AllLightNodeClients(ctx) + if err != nil { + return nil, err + } + + return &types.QueryLightNodeClientsResponse{ + LightNodeClients: clients, + }, nil +} diff --git a/x/paloma/keeper/keeper.go b/x/paloma/keeper/keeper.go index be3af992..3172e802 100644 --- a/x/paloma/keeper/keeper.go +++ b/x/paloma/keeper/keeper.go @@ -18,6 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -193,6 +194,13 @@ func (k Keeper) lightNodeClientLicenseStore( return prefix.NewStore(s, types.LightNodeClientLicenseKeyPrefix) } +func (k Keeper) lightNodeClientStore( + ctx context.Context, +) storetypes.KVStore { + s := runtime.KVStoreAdapter(k.storeKey.OpenKVStore(ctx)) + return prefix.NewStore(s, types.LightNodeClientKeyPrefix) +} + func (k Keeper) LightNodeClientFeegranter( ctx context.Context, ) (*types.LightNodeClientFeegranter, error) { @@ -444,5 +452,116 @@ func (k Keeper) CreateLightNodeClientAccount( // Delete the light node client funds k.lightNodeClientLicenseStore(ctx).Delete([]byte(addr)) - return nil + return k.SetLightNodeClient(ctx, + addr, + &types.LightNodeClient{ + ClientAddress: addr, + ActivatedAt: sdkCtx.BlockTime(), + LastAuthAt: sdkCtx.BlockTime(), + }) +} + +func (k Keeper) AllLightNodeClients( + ctx context.Context, +) ([]*types.LightNodeClient, error) { + st := k.lightNodeClientStore(ctx) + _, all, err := keeperutil.IterAll[*types.LightNodeClient](st, k.cdc) + return all, err +} + +func (k Keeper) SetLightNodeClient( + ctx context.Context, + addr string, + client *types.LightNodeClient, +) error { + st := k.lightNodeClientStore(ctx) + return keeperutil.Save(st, k.cdc, []byte(addr), client) +} + +func (k Keeper) GetLightNodeClient( + ctx context.Context, + addr string, +) (*types.LightNodeClient, error) { + st := k.lightNodeClientStore(ctx) + return keeperutil.Load[*types.LightNodeClient](st, k.cdc, []byte(addr)) +} + +// Since we didn't keep track of lightnodes in paloma, the way we get the legacy +// node addresses is by querying the grants on the lightnode feegranter address. +// Then, we remove the nodes waiting to be activated. +func (k Keeper) GetLegacyLightNodeClients( + ctx context.Context, +) ([]*types.LightNodeClient, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + nodes := make([]*types.LightNodeClient, 0) + + feegranter, err := k.LightNodeClientFeegranter(ctx) + if err != nil { + if errors.Is(err, keeperutil.ErrNotFound) { + return nil, nil + } + + return nil, err + } + + licenses, err := k.AllLightNodeClientLicenses(ctx) + if err != nil { + return nil, err + } + + var key []byte + for { + res, err := k.feegrantKeeper.AllowancesByGranter(ctx, + &feegrantmodule.QueryAllowancesByGranterRequest{ + Granter: feegranter.Account.String(), + Pagination: &query.PageRequest{ + Key: key, + }, + }, + ) + if err != nil { + return nil, err + } + + // Remove all lightnodes waiting to be activated + for _, grant := range res.Allowances { + // Check if the client is already on our list. + _, err := k.GetLightNodeClient(ctx, grant.Grantee) + if err != nil && !errors.Is(err, keeperutil.ErrNotFound) { + // Something went wrong with the store, returm immediately + return nil, err + } + + if err == nil { + // If the lightnode client is already on the list, don't add it + continue + } + + found := false + for _, license := range licenses { + if license.ClientAddress == grant.Grantee { + found = true + break + } + } + + if !found { + nodes = append(nodes, &types.LightNodeClient{ + ClientAddress: grant.Grantee, + ActivatedAt: sdkCtx.BlockTime(), + LastAuthAt: sdkCtx.BlockTime(), + }) + } + } + + if res.Pagination == nil || len(res.Pagination.NextKey) == 0 { + // There are no more results, just break + break + } + + // Move on to the next set of results + key = res.Pagination.NextKey + } + + return nodes, nil } diff --git a/x/paloma/keeper/msg_server.go b/x/paloma/keeper/msg_server.go index 06a7e180..6cfd0475 100644 --- a/x/paloma/keeper/msg_server.go +++ b/x/paloma/keeper/msg_server.go @@ -84,3 +84,37 @@ func (k msgServer) AddLightNodeClientLicense( return nil, err } + +func (k msgServer) AuthLightNodeClient( + ctx context.Context, + msg *types.MsgAuthLightNodeClient, +) (*types.EmptyResponse, error) { + client, err := k.GetLightNodeClient(ctx, msg.Metadata.Creator) + if err != nil { + return nil, err + } + + client.LastAuthAt = sdk.UnwrapSDKContext(ctx).BlockTime() + err = k.SetLightNodeClient(ctx, client.ClientAddress, client) + + return nil, err +} + +func (k msgServer) SetLegacyLightNodeClients( + ctx context.Context, + _ *types.MsgSetLegacyLightNodeClients, +) (*types.EmptyResponse, error) { + clients, err := k.GetLegacyLightNodeClients(ctx) + if err != nil { + return nil, err + } + + for _, client := range clients { + err = k.SetLightNodeClient(ctx, client.ClientAddress, client) + if err != nil { + return nil, err + } + } + + return nil, nil +} diff --git a/x/paloma/types/genesis.pb.go b/x/paloma/types/genesis.pb.go index 0c690482..e51cd9ca 100644 --- a/x/paloma/types/genesis.pb.go +++ b/x/paloma/types/genesis.pb.go @@ -29,6 +29,7 @@ type GenesisState struct { LightNodeClientLicenses []*LightNodeClientLicense `protobuf:"bytes,2,rep,name=light_node_client_licenses,json=lightNodeClientLicenses,proto3" json:"light_node_client_licenses,omitempty"` LightNodeClientFeegranter *LightNodeClientFeegranter `protobuf:"bytes,3,opt,name=light_node_client_feegranter,json=lightNodeClientFeegranter,proto3" json:"light_node_client_feegranter,omitempty"` LightNodeClientFunders *LightNodeClientFunders `protobuf:"bytes,4,opt,name=light_node_client_funders,json=lightNodeClientFunders,proto3" json:"light_node_client_funders,omitempty"` + LightNodeClients []*LightNodeClient `protobuf:"bytes,5,rep,name=light_node_clients,json=lightNodeClients,proto3" json:"light_node_clients,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -92,6 +93,13 @@ func (m *GenesisState) GetLightNodeClientFunders() *LightNodeClientFunders { return nil } +func (m *GenesisState) GetLightNodeClients() []*LightNodeClient { + if m != nil { + return m.LightNodeClients + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "palomachain.paloma.paloma.GenesisState") } @@ -101,28 +109,29 @@ func init() { } var fileDescriptor_7eb6079c96f2e090 = []byte{ - // 323 bytes of a gzipped FileDescriptorProto + // 352 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2,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8e, 0x2b, 0x96, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, 0x32, 0xc4, 0x63, 0xa8, 0x0f, 0x48, - 0xb3, 0x5f, 0x7e, 0x4a, 0xaa, 0x33, 0x58, 0xab, 0x0f, 0x44, 0x67, 0x90, 0x78, 0x0e, 0x56, 0xf1, - 0x62, 0xa1, 0x52, 0x2e, 0x19, 0x7c, 0xb1, 0x20, 0xc1, 0x0c, 0xf6, 0x86, 0x09, 0xf1, 0x36, 0xba, - 0xc1, 0xf5, 0x06, 0x49, 0xe6, 0xe0, 0x92, 0x12, 0xca, 0xe1, 0x92, 0xc4, 0x19, 0x7d, 0x12, 0x2c, - 0x60, 0x3b, 0x49, 0xf0, 0xa5, 0x1b, 0x44, 0x63, 0x90, 0x58, 0x0e, 0x56, 0x71, 0x27, 0xb7, 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, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, - 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0xc7, 0x12, 0xe7, 0x15, 0x30, 0x46, 0x49, 0x65, 0x41, 0x6a, 0x71, - 0x12, 0x1b, 0x38, 0xd6, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x84, 0xf9, 0x4e, 0x2d, - 0x03, 0x00, 0x00, + 0x4c, 0xcd, 0x2b, 0x81, 0x6a, 0xb1, 0x21, 0x41, 0x4b, 0x7c, 0x5a, 0x6a, 0x6a, 0x7a, 0x51, 0x62, + 0x5e, 0x49, 0x6a, 0x11, 0x54, 0xb7, 0x25, 0x49, 0xba, 0x4b, 0xf3, 0x52, 0x52, 0x8b, 0x8a, 0xc9, + 0xd1, 0x9a, 0x93, 0x99, 0x9c, 0x9a, 0x57, 0x9c, 0x0a, 0xd5, 0xaa, 0x86, 0x5b, 0x6b, 0x41, 0x62, + 0x51, 0x62, 0x2e, 0xd4, 0x0a, 0xa5, 0x7f, 0xcc, 0x5c, 0x3c, 0xee, 0x90, 0x10, 0x0d, 0x2e, 0x49, + 0x2c, 0x49, 0x15, 0xb2, 0xe7, 0x62, 0x83, 0x28, 0x90, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x36, 0x52, + 0xd4, 0xc3, 0x19, 0xc2, 0x7a, 0x01, 0x60, 0x85, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, + 0xb5, 0x09, 0xe5, 0x71, 0x49, 0xe1, 0x74, 0x5c, 0xb1, 0x04, 0x93, 0x02, 0xb3, 0x06, 0xb7, 0x91, + 0x21, 0x1e, 0x43, 0x7d, 0x40, 0x9a, 0xfd, 0xf2, 0x53, 0x52, 0x9d, 0xc1, 0x5a, 0x7d, 0x20, 0x3a, + 0x83, 0xc4, 0x73, 0xb0, 0x8a, 0x17, 0x0b, 0x95, 0x72, 0xc9, 0xe0, 0x8b, 0x05, 0x09, 0x66, 0xb0, + 0x37, 0x4c, 0x88, 0xb7, 0xd1, 0x0d, 0xae, 0x37, 0x48, 0x32, 0x07, 0x97, 0x94, 0x50, 0x0e, 0x97, + 0x24, 0xce, 0xe8, 0x93, 0x60, 0x01, 0xdb, 0x49, 0x82, 0x2f, 0xdd, 0x20, 0x1a, 0x83, 0xc4, 0x72, + 0xb0, 0x8a, 0x0b, 0x45, 0x70, 0x09, 0x61, 0xd8, 0x56, 0x2c, 0xc1, 0x0a, 0x0e, 0x4c, 0x2d, 0xe2, + 0xad, 0x09, 0x12, 0x40, 0x33, 0xbf, 0xd8, 0xc9, 0xf3, 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, 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xb1, + 0xa4, 0xa6, 0x32, 0x23, 0xfd, 0x0a, 0x18, 0xbb, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x9c, + 0xa4, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x51, 0xae, 0xc2, 0xbd, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -145,6 +154,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.LightNodeClients) > 0 { + for iNdEx := len(m.LightNodeClients) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LightNodeClients[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if m.LightNodeClientFunders != nil { { size, err := m.LightNodeClientFunders.MarshalToSizedBuffer(dAtA[:i]) @@ -229,6 +252,12 @@ func (m *GenesisState) Size() (n int) { l = m.LightNodeClientFunders.Size() n += 1 + l + sovGenesis(uint64(l)) } + if len(m.LightNodeClients) > 0 { + for _, e := range m.LightNodeClients { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -406,6 +435,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LightNodeClients", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LightNodeClients = append(m.LightNodeClients, &LightNodeClient{}) + if err := m.LightNodeClients[len(m.LightNodeClients)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/paloma/types/keys.go b/x/paloma/types/keys.go index 645b9ed9..d4b2920b 100644 --- a/x/paloma/types/keys.go +++ b/x/paloma/types/keys.go @@ -17,11 +17,12 @@ const ( MemStoreKey = "mem_paloma_store" ) -var LightNodeClientLicenseKeyPrefix = []byte("light-node-client-license") - -var LightNodeClientFeegranterKey = []byte("light-node-client-feegranter") - -var LightNodeClientFundersKey = []byte("light-node-client-funders") +var ( + LightNodeClientLicenseKeyPrefix = []byte("light-node-client-license") + LightNodeClientKeyPrefix = []byte("light-node-client-store") + LightNodeClientFeegranterKey = []byte("light-node-client-feegranter") + LightNodeClientFundersKey = []byte("light-node-client-funders") +) func KeyPrefix(p string) []byte { return []byte(p) diff --git a/x/paloma/types/light_node_client.pb.go b/x/paloma/types/light_node_client.pb.go new file mode 100644 index 00000000..834b5f4f --- /dev/null +++ b/x/paloma/types/light_node_client.pb.go @@ -0,0 +1,436 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: palomachain/paloma/paloma/light_node_client.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + 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. +// 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 LightNodeClient struct { + ClientAddress string `protobuf:"bytes,1,opt,name=client_address,json=clientAddress,proto3" json:"client_address,omitempty"` + ActivatedAt time.Time `protobuf:"bytes,2,opt,name=activated_at,json=activatedAt,proto3,stdtime" json:"activated_at"` + LastAuthAt time.Time `protobuf:"bytes,3,opt,name=last_auth_at,json=lastAuthAt,proto3,stdtime" json:"last_auth_at"` +} + +func (m *LightNodeClient) Reset() { *m = LightNodeClient{} } +func (m *LightNodeClient) String() string { return proto.CompactTextString(m) } +func (*LightNodeClient) ProtoMessage() {} +func (*LightNodeClient) Descriptor() ([]byte, []int) { + return fileDescriptor_f112d4742a1730b5, []int{0} +} +func (m *LightNodeClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LightNodeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LightNodeClient.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 *LightNodeClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_LightNodeClient.Merge(m, src) +} +func (m *LightNodeClient) XXX_Size() int { + return m.Size() +} +func (m *LightNodeClient) XXX_DiscardUnknown() { + xxx_messageInfo_LightNodeClient.DiscardUnknown(m) +} + +var xxx_messageInfo_LightNodeClient proto.InternalMessageInfo + +func (m *LightNodeClient) GetClientAddress() string { + if m != nil { + return m.ClientAddress + } + return "" +} + +func (m *LightNodeClient) GetActivatedAt() time.Time { + if m != nil { + return m.ActivatedAt + } + return time.Time{} +} + +func (m *LightNodeClient) GetLastAuthAt() time.Time { + if m != nil { + return m.LastAuthAt + } + return time.Time{} +} + +func init() { + proto.RegisterType((*LightNodeClient)(nil), "palomachain.paloma.paloma.LightNodeClient") +} + +func init() { + proto.RegisterFile("palomachain/paloma/paloma/light_node_client.proto", fileDescriptor_f112d4742a1730b5) +} + +var fileDescriptor_f112d4742a1730b5 = []byte{ + // 335 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xc1, 0x4a, 0xfb, 0x40, + 0x10, 0xc6, 0xb3, 0xff, 0x3f, 0x88, 0xa6, 0x55, 0x21, 0xf4, 0xd0, 0xf6, 0xb0, 0x2d, 0x9e, 0x7a, + 0x31, 0x4b, 0xeb, 0x03, 0x48, 0x2a, 0x28, 0x82, 0x78, 0xa8, 0x9e, 0xbc, 0x84, 0x4d, 0xb2, 0x6e, + 0x16, 0x92, 0x4c, 0xe8, 0x4e, 0x8a, 0xbe, 0x45, 0x1f, 0xc6, 0x87, 0xe8, 0xb1, 0x78, 0xf2, 0xa4, + 0xd2, 0xbc, 0x88, 0x24, 0x9b, 0x88, 0x07, 0x2f, 0x9e, 0xf6, 0x9b, 0x99, 0xef, 0x9b, 0xf9, 0xc1, + 0xda, 0xd3, 0x9c, 0x27, 0x90, 0xf2, 0x30, 0xe6, 0x2a, 0x63, 0x46, 0xb7, 0x4f, 0xa2, 0x64, 0x8c, + 0x7e, 0x06, 0x91, 0xf0, 0xc3, 0x44, 0x89, 0x0c, 0xdd, 0x7c, 0x09, 0x08, 0xce, 0xe0, 0x47, 0xc4, + 0x35, 0xba, 0x79, 0x86, 0x34, 0x04, 0x9d, 0x82, 0x66, 0x01, 0xd7, 0x82, 0xad, 0xa6, 0x81, 0x40, + 0x3e, 0x65, 0x21, 0x54, 0xbe, 0x2a, 0x3a, 0x1c, 0x98, 0xb9, 0x5f, 0x57, 0xcc, 0x14, 0xcd, 0xa8, + 0x27, 0x41, 0x82, 0xe9, 0x57, 0xaa, 0xe9, 0x8e, 0x24, 0x80, 0x4c, 0x04, 0xab, 0xab, 0xa0, 0x78, + 0x64, 0xa8, 0x52, 0xa1, 0x91, 0xa7, 0xb9, 0x31, 0x9c, 0x94, 0xc4, 0x3e, 0xbe, 0xa9, 0x40, 0x6f, + 0x21, 0x12, 0x17, 0x35, 0xa6, 0x73, 0x6e, 0x1f, 0x19, 0x60, 0x9f, 0x47, 0xd1, 0x52, 0x68, 0xdd, + 0x27, 0x63, 0x32, 0x39, 0x98, 0xf7, 0x5f, 0x5f, 0x4e, 0x7b, 0xcd, 0x51, 0xcf, 0x4c, 0xee, 0x70, + 0xa9, 0x32, 0xb9, 0x38, 0x34, 0xfe, 0xa6, 0xe9, 0x5c, 0xd9, 0x5d, 0x1e, 0xa2, 0x5a, 0x71, 0x14, + 0x91, 0xcf, 0xb1, 0xff, 0x6f, 0x4c, 0x26, 0x9d, 0xd9, 0xd0, 0x35, 0x30, 0x6e, 0x0b, 0xe3, 0xde, + 0xb7, 0x30, 0xf3, 0xfd, 0xcd, 0xfb, 0xc8, 0x5a, 0x7f, 0x8c, 0xc8, 0xa2, 0xf3, 0x9d, 0xf4, 0xd0, + 0xb9, 0xb4, 0xbb, 0x09, 0xd7, 0xe8, 0xf3, 0x02, 0xe3, 0x6a, 0xd1, 0xff, 0x3f, 0x2c, 0xb2, 0xab, + 0xa4, 0x57, 0x60, 0xec, 0xe1, 0xfc, 0x7a, 0xb3, 0xa3, 0x64, 0xbb, 0xa3, 0xe4, 0x73, 0x47, 0xc9, + 0xba, 0xa4, 0xd6, 0xb6, 0xa4, 0xd6, 0x5b, 0x49, 0xad, 0x07, 0x26, 0x15, 0xc6, 0x45, 0xe0, 0x86, + 0x90, 0xb2, 0x5f, 0xbe, 0x72, 0x35, 0x63, 0x4f, 0xad, 0xc6, 0xe7, 0x5c, 0xe8, 0x60, 0xaf, 0x3e, + 0x7a, 0xf6, 0x15, 0x00, 0x00, 0xff, 0xff, 0xce, 0xbd, 0xb7, 0xd1, 0xf9, 0x01, 0x00, 0x00, +} + +func (m *LightNodeClient) 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 *LightNodeClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LightNodeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.LastAuthAt, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastAuthAt):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintLightNodeClient(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + n2, err2 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.ActivatedAt, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivatedAt):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintLightNodeClient(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + if len(m.ClientAddress) > 0 { + i -= len(m.ClientAddress) + copy(dAtA[i:], m.ClientAddress) + i = encodeVarintLightNodeClient(dAtA, i, uint64(len(m.ClientAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintLightNodeClient(dAtA []byte, offset int, v uint64) int { + offset -= sovLightNodeClient(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LightNodeClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientAddress) + if l > 0 { + n += 1 + l + sovLightNodeClient(uint64(l)) + } + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.ActivatedAt) + n += 1 + l + sovLightNodeClient(uint64(l)) + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.LastAuthAt) + n += 1 + l + sovLightNodeClient(uint64(l)) + return n +} + +func sovLightNodeClient(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLightNodeClient(x uint64) (n int) { + return sovLightNodeClient(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *LightNodeClient) 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 ErrIntOverflowLightNodeClient + } + 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: LightNodeClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LightNodeClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLightNodeClient + } + 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 ErrInvalidLengthLightNodeClient + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLightNodeClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivatedAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLightNodeClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLightNodeClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLightNodeClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.ActivatedAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LastAuthAt", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLightNodeClient + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLightNodeClient + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLightNodeClient + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(&m.LastAuthAt, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLightNodeClient(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLightNodeClient + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLightNodeClient(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, ErrIntOverflowLightNodeClient + } + 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, ErrIntOverflowLightNodeClient + } + 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, ErrIntOverflowLightNodeClient + } + 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, ErrInvalidLengthLightNodeClient + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLightNodeClient + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLightNodeClient + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLightNodeClient = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLightNodeClient = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLightNodeClient = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/paloma/types/msg_auth_light_node_client.go b/x/paloma/types/msg_auth_light_node_client.go new file mode 100644 index 00000000..b2c722bd --- /dev/null +++ b/x/paloma/types/msg_auth_light_node_client.go @@ -0,0 +1,31 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/v2/util/libmeta" +) + +const TypeMsgAuthLightNodeClient = "auth_light_node_client" + +var _ sdk.Msg = &MsgAuthLightNodeClient{} + +func (msg *MsgAuthLightNodeClient) Route() string { + return RouterKey +} + +func (msg *MsgAuthLightNodeClient) Type() string { + return TypeMsgAddLightNodeClientLicense +} + +func (msg *MsgAuthLightNodeClient) GetSigners() []sdk.AccAddress { + return libmeta.GetSigners(msg) +} + +func (msg *MsgAuthLightNodeClient) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgAuthLightNodeClient) ValidateBasic() error { + return libmeta.ValidateBasic(msg) +} diff --git a/x/paloma/types/msg_set_legacy_light_node_clients.go b/x/paloma/types/msg_set_legacy_light_node_clients.go new file mode 100644 index 00000000..dcffe1ce --- /dev/null +++ b/x/paloma/types/msg_set_legacy_light_node_clients.go @@ -0,0 +1,31 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/palomachain/paloma/v2/util/libmeta" +) + +const TypeMsgSetLegacyLightNodeClients = "set_legacy_light_node_clients" + +var _ sdk.Msg = &MsgSetLegacyLightNodeClients{} + +func (msg *MsgSetLegacyLightNodeClients) Route() string { + return RouterKey +} + +func (msg *MsgSetLegacyLightNodeClients) Type() string { + return TypeMsgAddLightNodeClientLicense +} + +func (msg *MsgSetLegacyLightNodeClients) GetSigners() []sdk.AccAddress { + return libmeta.GetSigners(msg) +} + +func (msg *MsgSetLegacyLightNodeClients) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgSetLegacyLightNodeClients) ValidateBasic() error { + return libmeta.ValidateBasic(msg) +} diff --git a/x/paloma/types/params.pb.go b/x/paloma/types/params.pb.go index d1f4c440..2453802f 100644 --- a/x/paloma/types/params.pb.go +++ b/x/paloma/types/params.pb.go @@ -68,16 +68,17 @@ func init() { } var fileDescriptor_955ca3c86651c37b = []byte{ - // 142 bytes of a gzipped FileDescriptorProto + // 145 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2b, 0x48, 0xcc, 0xc9, 0xcf, 0x4d, 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x87, 0xb0, 0x11, 0x54, 0x51, 0x62, 0x6e, 0xb1, 0x5e, 0x41, 0x51, 0x7e, 0x49, 0xbe, 0x90, 0x24, 0x92, 0x3a, 0x3d, 0x08, 0x1b, 0x4a, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x55, 0xe9, 0x83, 0x58, 0x10, 0x0d, 0x4a, 0x7c, 0x5c, 0x6c, 0x01, - 0x60, 0x03, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x72, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, + 0x60, 0x03, 0xac, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, - 0xc6, 0x63, 0x39, 0x86, 0x28, 0x9d, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, - 0x7d, 0x2c, 0xae, 0xa9, 0x80, 0x31, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xc6, 0x1b, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xee, 0x4d, 0x5b, 0x0b, 0xb9, 0x00, 0x00, 0x00, + 0xc6, 0x63, 0x39, 0x86, 0x28, 0xfd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, + 0x7d, 0x2c, 0xae, 0x29, 0x33, 0xd2, 0xaf, 0x80, 0xb1, 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, + 0xc0, 0x36, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x8f, 0x78, 0x5e, 0xbc, 0x00, 0x00, + 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { diff --git a/x/paloma/types/query.pb.go b/x/paloma/types/query.pb.go index 71c6ce43..4d67dca1 100644 --- a/x/paloma/types/query.pb.go +++ b/x/paloma/types/query.pb.go @@ -248,12 +248,57 @@ func (m *QueryLightNodeClientFundersResponse) GetLightNodeClientFunders() *Light return nil } +type QueryLightNodeClientsResponse struct { + LightNodeClients []*LightNodeClient `protobuf:"bytes,1,rep,name=light_node_clients,json=lightNodeClients,proto3" json:"light_node_clients,omitempty"` +} + +func (m *QueryLightNodeClientsResponse) Reset() { *m = QueryLightNodeClientsResponse{} } +func (m *QueryLightNodeClientsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLightNodeClientsResponse) ProtoMessage() {} +func (*QueryLightNodeClientsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8265cbfb24a07e7a, []int{5} +} +func (m *QueryLightNodeClientsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLightNodeClientsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLightNodeClientsResponse.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 *QueryLightNodeClientsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLightNodeClientsResponse.Merge(m, src) +} +func (m *QueryLightNodeClientsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLightNodeClientsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLightNodeClientsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLightNodeClientsResponse proto.InternalMessageInfo + +func (m *QueryLightNodeClientsResponse) GetLightNodeClients() []*LightNodeClient { + if m != nil { + return m.LightNodeClients + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "palomachain.paloma.paloma.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "palomachain.paloma.paloma.QueryParamsResponse") proto.RegisterType((*QueryLightNodeClientLicensesResponse)(nil), "palomachain.paloma.paloma.QueryLightNodeClientLicensesResponse") proto.RegisterType((*QueryLightNodeClientFeegranterResponse)(nil), "palomachain.paloma.paloma.QueryLightNodeClientFeegranterResponse") proto.RegisterType((*QueryLightNodeClientFundersResponse)(nil), "palomachain.paloma.paloma.QueryLightNodeClientFundersResponse") + proto.RegisterType((*QueryLightNodeClientsResponse)(nil), "palomachain.paloma.paloma.QueryLightNodeClientsResponse") } func init() { @@ -261,43 +306,46 @@ func init() { } var fileDescriptor_8265cbfb24a07e7a = []byte{ - // 563 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0x6b, 0x60, 0x3d, 0x78, 0x37, 0x33, 0x0d, 0x1a, 0xaa, 0xc0, 0x32, 0x98, 0x06, 0x82, - 0x58, 0xed, 0x98, 0xa6, 0x89, 0x1f, 0x15, 0x43, 0x8c, 0xcb, 0x84, 0xa0, 0x07, 0x0e, 0x5c, 0x2a, - 0x37, 0xf5, 0xd2, 0x48, 0x89, 0x9d, 0xc5, 0x0e, 0x62, 0x57, 0xfe, 0x02, 0xc4, 0x24, 0xae, 0xfc, - 0x0b, 0x1c, 0x38, 0x71, 0xe5, 0xb2, 0xe3, 0x24, 0x2e, 0x9c, 0x10, 0x6a, 0xf9, 0x43, 0x50, 0x6c, - 0xb7, 0xdb, 0xd4, 0xa4, 0x5d, 0x7a, 0xca, 0x8b, 0x9d, 0xef, 0x7b, 0x1f, 0xfb, 0x7d, 0x5f, 0xe0, - 0x9d, 0x98, 0x84, 0x3c, 0x22, 0x5e, 0x9f, 0x04, 0x0c, 0xeb, 0x78, 0xf4, 0x38, 0x48, 0x69, 0x72, - 0xe8, 0xc6, 0x09, 0x97, 0x1c, 0xd5, 0xce, 0x7c, 0xe6, 0xea, 0xd8, 0x3c, 0xac, 0x7b, 0x1e, 0x17, - 0x11,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xde, 0x79, 0xa4, - 0xb0, 0x37, 0xd1, 0x06, 0x2e, 0xff, 0xbb, 0xdd, 0xd9, 0x3d, 0x1e, 0xd8, 0xe0, 0x64, 0x60, 0x83, - 0xbf, 0x03, 0x1b, 0x7c, 0x1a, 0xda, 0x95, 0x93, 0xa1, 0x5d, 0xf9, 0x3d, 0xb4, 0x2b, 0xef, 0xee, - 0xfb, 0x81, 0xec, 0xa7, 0x5d, 0xd7, 0xe3, 0x51, 0x5e, 0xe2, 0x0f, 0xa3, 0x40, 0x1e, 0xc6, 0x54, - 0x74, 0xab, 0xea, 0x50, 0x1b, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x76, 0x06, 0x7a, 0xf0, - 0x06, 0x00, 0x00, + // 617 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x6f, 0xd3, 0x3e, + 0x18, 0xc7, 0xeb, 0xdf, 0x0f, 0x7a, 0xf0, 0x2e, 0xc8, 0x9b, 0x06, 0x0d, 0x23, 0xb0, 0x0c, 0xa6, + 0x31, 0x69, 0xb1, 0x5a, 0x36, 0xc6, 0xa4, 0x41, 0xc5, 0x10, 0x20, 0xa4, 0x09, 0x41, 0x0f, 0x08, + 0x71, 0xa9, 0xdc, 0xd6, 0x4b, 0x23, 0xa5, 0x76, 0x16, 0x3b, 0x13, 0xbd, 0xf2, 0x0a, 0x10, 0x93, + 0x38, 0xc2, 0x6b, 0x40, 0xe2, 0xc4, 0x2b, 0xd8, 0x71, 0x12, 0x17, 0x4e, 0x08, 0xb5, 0xf0, 0x3e, + 0x50, 0x6d, 0xb7, 0xdd, 0x68, 0xd2, 0x36, 0x3d, 0xe5, 0xc9, 0xe3, 0x7c, 0x9f, 0xe7, 0xe3, 0x3c, + 0x7f, 0xe0, 0xad, 0x90, 0x04, 0xbc, 0x45, 0xea, 0x4d, 0xe2, 0x33, 0xac, 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f, 0x21, 0x6e, 0xa3, 0x2d, 0x3c, + 0xc3, 0xf2, 0x10, 0xe8, 0x1b, 0x80, 0x4b, 0xa3, 0xd8, 0xc3, 0x3e, 0x4c, 0x05, 0x7f, 0x98, 0x11, + 0x7c, 0x74, 0xb2, 0x9c, 0xb2, 0x42, 0xdf, 0x41, 0xdb, 0x78, 0xb6, 0x85, 0x8b, 0xbe, 0x00, 0x58, + 0x48, 0x80, 0xd7, 0xbd, 0x9a, 0x4a, 0xfe, 0x20, 0x2b, 0xf9, 0xf9, 0x89, 0x73, 0x76, 0x15, 0xf6, + 0x5d, 0xb4, 0x89, 0x67, 0xd8, 0xf4, 0xe8, 0x13, 0x80, 0xf3, 0xa3, 0xcc, 0xe9, 0xb4, 0xf7, 0x32, + 0xd2, 0x0e, 0x39, 0xb7, 0x14, 0x27, 0x46, 0x1b, 0x59, 0x38, 0xc5, 0xde, 0xb3, 0x93, 0x8e, 0x0d, + 0x4e, 0x3b, 0x36, 0xf8, 0xd5, 0xb1, 0xc1, 0xfb, 0xae, 0x9d, 0x3b, 0xed, 0xda, 0xb9, 0x1f, 0x5d, + 0x3b, 0xf7, 0x06, 0x7b, 0xbe, 0x6c, 0xc6, 0x35, 0xb7, 0xce, 0x5b, 0x49, 0x21, 0x8f, 0x4a, 0xf8, + 0x6d, 0xdf, 0x96, 0xed, 0x90, 0x8a, 0x5a, 0x5e, 0xdd, 0xe5, 0xce, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe4, 0x9e, 0x1c, 0x5b, 0x43, 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -317,6 +365,7 @@ type QueryClient interface { GetLightNodeClientLicenses(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryLightNodeClientLicensesResponse, error) GetLightNodeClientFeegranter(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryLightNodeClientFeegranterResponse, error) GetLightNodeClientFunders(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryLightNodeClientFundersResponse, error) + GetLightNodeClients(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryLightNodeClientsResponse, error) } type queryClient struct { @@ -363,6 +412,15 @@ func (c *queryClient) GetLightNodeClientFunders(ctx context.Context, in *emptypb return out, nil } +func (c *queryClient) GetLightNodeClients(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*QueryLightNodeClientsResponse, error) { + out := new(QueryLightNodeClientsResponse) + err := c.cc.Invoke(ctx, "/palomachain.paloma.paloma.Query/GetLightNodeClients", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -370,6 +428,7 @@ type QueryServer interface { GetLightNodeClientLicenses(context.Context, *emptypb.Empty) (*QueryLightNodeClientLicensesResponse, error) GetLightNodeClientFeegranter(context.Context, *emptypb.Empty) (*QueryLightNodeClientFeegranterResponse, error) GetLightNodeClientFunders(context.Context, *emptypb.Empty) (*QueryLightNodeClientFundersResponse, error) + GetLightNodeClients(context.Context, *emptypb.Empty) (*QueryLightNodeClientsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -388,6 +447,9 @@ func (*UnimplementedQueryServer) GetLightNodeClientFeegranter(ctx context.Contex func (*UnimplementedQueryServer) GetLightNodeClientFunders(ctx context.Context, req *emptypb.Empty) (*QueryLightNodeClientFundersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLightNodeClientFunders not implemented") } +func (*UnimplementedQueryServer) GetLightNodeClients(ctx context.Context, req *emptypb.Empty) (*QueryLightNodeClientsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLightNodeClients not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -465,6 +527,24 @@ func _Query_GetLightNodeClientFunders_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _Query_GetLightNodeClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetLightNodeClients(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.paloma.Query/GetLightNodeClients", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetLightNodeClients(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "palomachain.paloma.paloma.Query", HandlerType: (*QueryServer)(nil), @@ -485,6 +565,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetLightNodeClientFunders", Handler: _Query_GetLightNodeClientFunders_Handler, }, + { + MethodName: "GetLightNodeClients", + Handler: _Query_GetLightNodeClients_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "palomachain/paloma/paloma/query.proto", @@ -653,6 +737,43 @@ func (m *QueryLightNodeClientFundersResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } +func (m *QueryLightNodeClientsResponse) 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 *QueryLightNodeClientsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLightNodeClientsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LightNodeClients) > 0 { + for iNdEx := len(m.LightNodeClients) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LightNodeClients[iNdEx].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 @@ -725,6 +846,21 @@ func (m *QueryLightNodeClientFundersResponse) Size() (n int) { return n } +func (m *QueryLightNodeClientsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LightNodeClients) > 0 { + for _, e := range m.LightNodeClients { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1120,6 +1256,90 @@ func (m *QueryLightNodeClientFundersResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryLightNodeClientsResponse) 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: QueryLightNodeClientsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLightNodeClientsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LightNodeClients", 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 + } + m.LightNodeClients = append(m.LightNodeClients, &LightNodeClient{}) + if err := m.LightNodeClients[len(m.LightNodeClients)-1].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) || (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 diff --git a/x/paloma/types/query.pb.gw.go b/x/paloma/types/query.pb.gw.go index 2b9b7b25..1b82d933 100644 --- a/x/paloma/types/query.pb.gw.go +++ b/x/paloma/types/query.pb.gw.go @@ -106,6 +106,24 @@ func local_request_Query_GetLightNodeClientFunders_0(ctx context.Context, marsha } +func request_Query_GetLightNodeClients_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := client.GetLightNodeClients(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetLightNodeClients_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq emptypb.Empty + var metadata runtime.ServerMetadata + + msg, err := server.GetLightNodeClients(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -204,6 +222,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_GetLightNodeClients_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetLightNodeClients_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetLightNodeClients_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -325,6 +366,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_GetLightNodeClients_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetLightNodeClients_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_GetLightNodeClients_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -335,7 +396,9 @@ var ( pattern_Query_GetLightNodeClientFeegranter_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"palomachain", "paloma", "light_node_client_feegranter"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GetLightNodeClientFunders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"palomachain", "paloma", "light_node_client_funder"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetLightNodeClientFunders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"palomachain", "paloma", "light_node_client_funders"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_GetLightNodeClients_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 1, 2, 2}, []string{"palomachain", "paloma", "light_node_clients"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -346,4 +409,6 @@ var ( forward_Query_GetLightNodeClientFeegranter_0 = runtime.ForwardResponseMessage forward_Query_GetLightNodeClientFunders_0 = runtime.ForwardResponseMessage + + forward_Query_GetLightNodeClients_0 = runtime.ForwardResponseMessage ) diff --git a/x/paloma/types/tx.pb.go b/x/paloma/types/tx.pb.go index a8018283..e4110410 100644 --- a/x/paloma/types/tx.pb.go +++ b/x/paloma/types/tx.pb.go @@ -328,6 +328,94 @@ func (m *MsgAddLightNodeClientLicense) GetVestingMonths() uint32 { return 0 } +type MsgAuthLightNodeClient struct { + Metadata types.MsgMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` +} + +func (m *MsgAuthLightNodeClient) Reset() { *m = MsgAuthLightNodeClient{} } +func (m *MsgAuthLightNodeClient) String() string { return proto.CompactTextString(m) } +func (*MsgAuthLightNodeClient) ProtoMessage() {} +func (*MsgAuthLightNodeClient) Descriptor() ([]byte, []int) { + return fileDescriptor_8dc46060aeb172a8, []int{4} +} +func (m *MsgAuthLightNodeClient) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuthLightNodeClient) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuthLightNodeClient.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 *MsgAuthLightNodeClient) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuthLightNodeClient.Merge(m, src) +} +func (m *MsgAuthLightNodeClient) XXX_Size() int { + return m.Size() +} +func (m *MsgAuthLightNodeClient) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuthLightNodeClient.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuthLightNodeClient proto.InternalMessageInfo + +func (m *MsgAuthLightNodeClient) GetMetadata() types.MsgMetadata { + if m != nil { + return m.Metadata + } + return types.MsgMetadata{} +} + +type MsgSetLegacyLightNodeClients struct { + Metadata types.MsgMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"` +} + +func (m *MsgSetLegacyLightNodeClients) Reset() { *m = MsgSetLegacyLightNodeClients{} } +func (m *MsgSetLegacyLightNodeClients) String() string { return proto.CompactTextString(m) } +func (*MsgSetLegacyLightNodeClients) ProtoMessage() {} +func (*MsgSetLegacyLightNodeClients) Descriptor() ([]byte, []int) { + return fileDescriptor_8dc46060aeb172a8, []int{5} +} +func (m *MsgSetLegacyLightNodeClients) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetLegacyLightNodeClients) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetLegacyLightNodeClients.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 *MsgSetLegacyLightNodeClients) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetLegacyLightNodeClients.Merge(m, src) +} +func (m *MsgSetLegacyLightNodeClients) XXX_Size() int { + return m.Size() +} +func (m *MsgSetLegacyLightNodeClients) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetLegacyLightNodeClients.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetLegacyLightNodeClients proto.InternalMessageInfo + +func (m *MsgSetLegacyLightNodeClients) GetMetadata() types.MsgMetadata { + if m != nil { + return m.Metadata + } + return types.MsgMetadata{} +} + func init() { proto.RegisterEnum("palomachain.paloma.paloma.MsgAddStatusUpdate_Level", MsgAddStatusUpdate_Level_name, MsgAddStatusUpdate_Level_value) proto.RegisterType((*MsgAddStatusUpdate)(nil), "palomachain.paloma.paloma.MsgAddStatusUpdate") @@ -335,6 +423,8 @@ func init() { proto.RegisterType((*EmptyResponse)(nil), "palomachain.paloma.paloma.EmptyResponse") proto.RegisterType((*MsgRegisterLightNodeClient)(nil), "palomachain.paloma.paloma.MsgRegisterLightNodeClient") proto.RegisterType((*MsgAddLightNodeClientLicense)(nil), "palomachain.paloma.paloma.MsgAddLightNodeClientLicense") + proto.RegisterType((*MsgAuthLightNodeClient)(nil), "palomachain.paloma.paloma.MsgAuthLightNodeClient") + proto.RegisterType((*MsgSetLegacyLightNodeClients)(nil), "palomachain.paloma.paloma.MsgSetLegacyLightNodeClients") } func init() { @@ -342,48 +432,51 @@ func init() { } var fileDescriptor_8dc46060aeb172a8 = []byte{ - // 642 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0x8e, 0x73, 0xe9, 0xdf, 0x7f, 0x42, 0xd2, 0x68, 0x54, 0x51, 0x27, 0x42, 0x26, 0xb2, 0x44, - 0x15, 0x21, 0x6a, 0xab, 0xa9, 0xa0, 0xa2, 0x1b, 0xd4, 0x94, 0x14, 0x0a, 0x49, 0x8b, 0x5c, 0xda, - 0x05, 0x9b, 0x68, 0x62, 0x8f, 0x26, 0x06, 0xdb, 0x63, 0x79, 0x26, 0x56, 0xc3, 0x82, 0x05, 0x4f, - 0xc0, 0x92, 0x47, 0x60, 0xc9, 0x82, 0x87, 0xe8, 0xb2, 0x62, 0xc5, 0x0a, 0xa1, 0x76, 0xc1, 0x8a, - 0x77, 0x40, 0xf6, 0x0c, 0xa5, 0x0d, 0x49, 0xa1, 0x82, 0xd5, 0x9c, 0xfb, 0x77, 0xce, 0xd1, 0x77, - 0x06, 0xe8, 0x21, 0xf2, 0xa8, 0x8f, 0xec, 0x01, 0x72, 0x03, 0x53, 0xc8, 0x3f, 0x1e, 0x7e, 0x60, - 0x84, 0x11, 0xe5, 0x14, 0x56, 0xcf, 0xc4, 0x18, 0x42, 0x96, 0x4f, 0x4d, 0xb3, 0x29, 0xf3, 0x29, - 0x33, 0xfb, 0x88, 0x61, 0x33, 0x5e, 0xee, 0x63, 0x8e, 0x96, 0x4d, 0x9b, 0x26, 0x71, 0x49, 0x6a, - 0x6d, 0x41, 0xfa, 0x7d, 0x46, 0xcc, 0x78, 0x39, 0x79, 0xa4, 0xa3, 0x2a, 0x1c, 0xbd, 0x54, 0x33, - 0x85, 0x22, 0x5d, 0xf3, 0x84, 0x12, 0x2a, 0xec, 0x89, 0x24, 0xad, 0x8b, 0x13, 0x1a, 0x8d, 0x91, - 0xc7, 0x30, 0x37, 0x6d, 0xea, 0xfb, 0x54, 0x22, 0xea, 0xef, 0x72, 0x00, 0x76, 0x19, 0x59, 0x77, - 0x9c, 0x5d, 0x8e, 0xf8, 0x90, 0xed, 0x85, 0x0e, 0xe2, 0x18, 0x5e, 0x05, 0x33, 0x2c, 0xd5, 0xd5, - 0x6c, 0x5d, 0x69, 0xfc, 0x6f, 0x49, 0x0d, 0x6e, 0x81, 0x82, 0x87, 0x63, 0xec, 0xa9, 0xb9, 0xba, - 0xd2, 0x28, 0x37, 0x57, 0x8c, 0xa9, 0xb3, 0x1a, 0xbf, 0x56, 0x35, 0x3a, 0x49, 0xaa, 0x25, 0x2a, - 0xc0, 0x87, 0x60, 0xd6, 0xc7, 0x1c, 0x39, 0x88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, 0x36, 0xf5, 0xcd, 0x09, 0x5f, 0xe1, 0xc1, 0xe9, 0xaf, 0x3d, 0x0a, 0x31, 0xeb, 0xcf, - 0xa4, 0x9f, 0xe1, 0xca, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x98, 0xb4, 0x78, 0x19, 0xdf, 0x05, - 0x00, 0x00, + // 694 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0x8e, 0x73, 0xe9, 0xdf, 0xff, 0x84, 0xa4, 0xd1, 0x50, 0xb5, 0x49, 0x84, 0x4c, 0x14, 0x89, + 0x2a, 0x42, 0xaa, 0xad, 0xa4, 0x82, 0x8a, 0x6e, 0x50, 0x53, 0x02, 0x14, 0x92, 0x16, 0xb9, 0xb4, + 0x0b, 0x36, 0xd1, 0xc4, 0x1e, 0x4d, 0x0c, 0xb1, 0x27, 0x78, 0x26, 0xa1, 0x61, 0xc1, 0x82, 0x27, + 0x60, 0xc9, 0x23, 0xb0, 0x64, 0xc1, 0x43, 0x74, 0x59, 0xb1, 0x62, 0x85, 0xa0, 0x5d, 0xf0, 0x1a, + 0xc8, 0xf6, 0x50, 0xda, 0x34, 0x69, 0x88, 0xb8, 0xac, 0x66, 0xce, 0xe5, 0x3b, 0xdf, 0x9c, 0xe3, + 0x6f, 0x3c, 0x50, 0xec, 0xe2, 0x0e, 0x73, 0xb0, 0xd9, 0xc6, 0xb6, 0xab, 0x87, 0xfb, 0x1f, 0x8b, + 0xd8, 0xd7, 0xba, 0x1e, 0x13, 0x0c, 0xe5, 0x4e, 0xe5, 0x68, 0xe1, 0x5e, 0x2e, 0x79, 0xd5, 0x64, + 0xdc, 0x61, 0x5c, 0x6f, 0x61, 0x4e, 0xf4, 0x7e, 0xb9, 0x45, 0x04, 0x2e, 0xeb, 0x26, 0xf3, 0xf3, + 0x7c, 0x68, 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0xc8, 0xe8, 0xc2, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -401,6 +494,8 @@ type MsgClient interface { AddStatusUpdate(ctx context.Context, in *MsgAddStatusUpdate, opts ...grpc.CallOption) (*EmptyResponse, error) RegisterLightNodeClient(ctx context.Context, in *MsgRegisterLightNodeClient, opts ...grpc.CallOption) (*EmptyResponse, error) AddLightNodeClientLicense(ctx context.Context, in *MsgAddLightNodeClientLicense, opts ...grpc.CallOption) (*EmptyResponse, error) + AuthLightNodeClient(ctx context.Context, in *MsgAuthLightNodeClient, opts ...grpc.CallOption) (*EmptyResponse, error) + SetLegacyLightNodeClients(ctx context.Context, in *MsgSetLegacyLightNodeClients, opts ...grpc.CallOption) (*EmptyResponse, error) } type msgClient struct { @@ -438,11 +533,31 @@ func (c *msgClient) AddLightNodeClientLicense(ctx context.Context, in *MsgAddLig return out, nil } +func (c *msgClient) AuthLightNodeClient(ctx context.Context, in *MsgAuthLightNodeClient, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/palomachain.paloma.paloma.Msg/AuthLightNodeClient", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetLegacyLightNodeClients(ctx context.Context, in *MsgSetLegacyLightNodeClients, opts ...grpc.CallOption) (*EmptyResponse, error) { + out := new(EmptyResponse) + err := c.cc.Invoke(ctx, "/palomachain.paloma.paloma.Msg/SetLegacyLightNodeClients", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { AddStatusUpdate(context.Context, *MsgAddStatusUpdate) (*EmptyResponse, error) RegisterLightNodeClient(context.Context, *MsgRegisterLightNodeClient) (*EmptyResponse, error) AddLightNodeClientLicense(context.Context, *MsgAddLightNodeClientLicense) (*EmptyResponse, error) + AuthLightNodeClient(context.Context, *MsgAuthLightNodeClient) (*EmptyResponse, error) + SetLegacyLightNodeClients(context.Context, *MsgSetLegacyLightNodeClients) (*EmptyResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -458,6 +573,12 @@ func (*UnimplementedMsgServer) RegisterLightNodeClient(ctx context.Context, req func (*UnimplementedMsgServer) AddLightNodeClientLicense(ctx context.Context, req *MsgAddLightNodeClientLicense) (*EmptyResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddLightNodeClientLicense not implemented") } +func (*UnimplementedMsgServer) AuthLightNodeClient(ctx context.Context, req *MsgAuthLightNodeClient) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuthLightNodeClient not implemented") +} +func (*UnimplementedMsgServer) SetLegacyLightNodeClients(ctx context.Context, req *MsgSetLegacyLightNodeClients) (*EmptyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetLegacyLightNodeClients not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -517,6 +638,42 @@ func _Msg_AddLightNodeClientLicense_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Msg_AuthLightNodeClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAuthLightNodeClient) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AuthLightNodeClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.paloma.Msg/AuthLightNodeClient", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AuthLightNodeClient(ctx, req.(*MsgAuthLightNodeClient)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetLegacyLightNodeClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetLegacyLightNodeClients) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetLegacyLightNodeClients(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/palomachain.paloma.paloma.Msg/SetLegacyLightNodeClients", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetLegacyLightNodeClients(ctx, req.(*MsgSetLegacyLightNodeClients)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "palomachain.paloma.paloma.Msg", HandlerType: (*MsgServer)(nil), @@ -533,6 +690,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddLightNodeClientLicense", Handler: _Msg_AddLightNodeClientLicense_Handler, }, + { + MethodName: "AuthLightNodeClient", + Handler: _Msg_AuthLightNodeClient_Handler, + }, + { + MethodName: "SetLegacyLightNodeClients", + Handler: _Msg_SetLegacyLightNodeClients_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "palomachain/paloma/paloma/tx.proto", @@ -745,6 +910,72 @@ func (m *MsgAddLightNodeClientLicense) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *MsgAuthLightNodeClient) 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 *MsgAuthLightNodeClient) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuthLightNodeClient) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Metadata.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 *MsgSetLegacyLightNodeClients) 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 *MsgSetLegacyLightNodeClients) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetLegacyLightNodeClients) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Metadata.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 encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -837,6 +1068,28 @@ func (m *MsgAddLightNodeClientLicense) Size() (n int) { return n } +func (m *MsgAuthLightNodeClient) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSetLegacyLightNodeClients) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1425,6 +1678,172 @@ func (m *MsgAddLightNodeClientLicense) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAuthLightNodeClient) 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: MsgAuthLightNodeClient: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuthLightNodeClient: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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 := m.Metadata.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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetLegacyLightNodeClients) 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: MsgSetLegacyLightNodeClients: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetLegacyLightNodeClients: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", 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 := m.Metadata.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) || (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