diff --git a/proto/sedachain/data_proxy/v1/data_proxy_registry.proto b/proto/sedachain/data_proxy/v1/data_proxy_registry.proto new file mode 100644 index 00000000..6f83f28b --- /dev/null +++ b/proto/sedachain/data_proxy/v1/data_proxy_registry.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package sedachain.data_proxy.v1; + +import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types"; + +// Module parameters which can be changed through governance. +message Params { + option (gogoproto.equal) = true; + + // min_fee_update_delay is the minimum number of blocks after which a fee + // update comes into effect. + uint32 min_fee_update_delay = 1; +} + +// ProxyConfig defines a data-proxy entry in the registry. +message ProxyConfig { + // payout_address defines the address to which the data proxy fees should be + // transferred. + string payout_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + // fee defines the amount in aseda this data-proxy charges when utilised. + cosmos.base.v1beta1.Coin fee = 2; + + // memo defines an optional string which is not used by the protocol. + string memo = 3; + + // fee_update defines an upcoming fee change which will take effect at a + // future height. + FeeUpdate fee_update = 4 [ (gogoproto.nullable) = true ]; +} + +// FeeUpdate defines a new fee amount and the height at which it will take +// effect. +message FeeUpdate { + // new_fee defines the new fee for the data proxy. + cosmos.base.v1beta1.Coin new_fee = 1 [ (gogoproto.nullable) = false ]; + + // update_height defines the height at which the new fee comes into effect. + int64 update_height = 2; +} \ No newline at end of file diff --git a/proto/sedachain/data_proxy/v1/genesis.proto b/proto/sedachain/data_proxy/v1/genesis.proto new file mode 100644 index 00000000..d8324384 --- /dev/null +++ b/proto/sedachain/data_proxy/v1/genesis.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package sedachain.data_proxy.v1; + +import "gogoproto/gogo.proto"; +import "sedachain/data_proxy/v1/data_proxy.proto"; + +option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types"; + +// GenesisState defines data_proxy module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + + repeated DataProxyConfigs data_proxy_configs = 2 + [ (gogoproto.nullable) = false ]; + + repeated FeeUpdateQueueRecord fee_update_queue = 3 + [ (gogoproto.nullable) = false ]; +} + +// DataProxyConfigs define the data proxy entries in the registry. +message DataProxyConfigs { + string data_proxy_pubkey = 1; + + ProxyConfig config = 2; +} + +// FeeUpdateQueueRecord defines an entry in the data proxy update queue. +message FeeUpdateQueueRecord { + string data_proxy_pubkey = 1; + + int64 update_height = 2; +} \ No newline at end of file diff --git a/proto/sedachain/data_proxy/v1/query.proto b/proto/sedachain/data_proxy/v1/query.proto new file mode 100644 index 00000000..339c9197 --- /dev/null +++ b/proto/sedachain/data_proxy/v1/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package sedachain.data_proxy.v1; + +import "google/api/annotations.proto"; +import "sedachain/data_proxy/v1/data_proxy.proto"; + +option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types"; + +// Query defines the gRPC querier service. +service Query { + // DataProxyConfig returns a data proxy config when given its public key as a + // hex encoded string. + rpc DataProxyConfig(QueryDataProxyConfigRequest) + returns (QueryDataProxyConfigResponse) { + option (google.api.http).get = + "/seda-chain/data-proxy/data-proxy/{pub_key}"; + } +} + +// The request message for QueryDataProxyConfig RPC method. +message QueryDataProxyConfigRequest { + // A hex encoded string of the public key of the data proxy. + string pub_key = 1; +} + +// The response message for QueryDataProxyConfig RPC method. +message QueryDataProxyConfigResponse { ProxyConfig config = 1; } diff --git a/proto/sedachain/data_proxy/v1/tx.proto b/proto/sedachain/data_proxy/v1/tx.proto new file mode 100644 index 00000000..bed872ef --- /dev/null +++ b/proto/sedachain/data_proxy/v1/tx.proto @@ -0,0 +1,76 @@ +syntax = "proto3"; +package sedachain.data_proxy.v1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/msg/v1/msg.proto"; +import "sedachain/data_proxy/v1/data_proxy.proto"; + +option go_package = "github.com/sedaprotocol/seda-chain/x/data-proxy/types"; + +// Msg service defines the data-proxy tx gRPC methods. +service Msg { + // Registers a new data proxy entry in the registry. + rpc RegisterDataProxy(MsgRegisterDataProxy) + returns (MsgRegisterDataProxyResponse); + + // Edits an existing data proxy. + rpc EditDataProxy(MsgEditDataProxy) returns (MsgEditDataProxyResponse); + + // Used to update the modules parameters through governance. + rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); +} + +// All data required for a new data proxy. +message MsgRegisterDataProxy { + string payout_address = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + cosmos.base.v1beta1.Coin fee = 2; + + string memo = 3; + + google.protobuf.Any pub_key = 4 + [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; + + bytes signature = 5; +} + +// No response required. +message MsgRegisterDataProxyResponse {} + +// Allow updating memo and payout address instantly and/or scheduling a fee +// update. +message MsgEditDataProxy { + string new_payout_address = 1 + [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + string new_memo = 2 [ (gogoproto.nullable) = true ]; + + cosmos.base.v1beta1.Coin new_fee = 3 [ (gogoproto.nullable) = true ]; + + uint32 fee_update_delay = 4 [ (gogoproto.nullable) = true ]; + + google.protobuf.Any pub_key = 5 + [ (cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey" ]; + + bytes signature = 6; +} + +// Returns the height at which the fee update will go into effect. +message MsgEditDataProxyResponse { int64 update_height = 1; } + +// The request message for the UpdateParams method. +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ]; + + Params params = 2 [ (gogoproto.nullable) = false ]; +} + +// No response required. +message MsgUpdateParamsResponse {} \ No newline at end of file diff --git a/x/data-proxy/client/cli/query.go b/x/data-proxy/client/cli/query.go new file mode 100644 index 00000000..9bcc0bd3 --- /dev/null +++ b/x/data-proxy/client/cli/query.go @@ -0,0 +1,55 @@ +package cli + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +// GetQueryCmd returns the CLI query commands for this module +func GetQueryCmd(_ string) *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + GetDataProxyConfig(), + ) + return cmd +} + +// GetDataProxyConfig returns the command for querying the config of a given data proxy. +func GetDataProxyConfig() *cobra.Command { + cmd := &cobra.Command{ + Use: "data-proxy-config ", + Short: "Query a data proxy config by its hex encoded public key", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryDataProxyConfigRequest{ + PubKey: args[0], + } + res, err := queryClient.DataProxyConfig(cmd.Context(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/data-proxy/client/cli/tx.go b/x/data-proxy/client/cli/tx.go new file mode 100644 index 00000000..83f8e90f --- /dev/null +++ b/x/data-proxy/client/cli/tx.go @@ -0,0 +1,53 @@ +package cli + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +// GetTxCmd returns the CLI transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + cmd.AddCommand( + RegisterDataProxy(), + ) + return cmd +} + +// AddKey returns the command for adding a new key and uploading its +// public key on chain at a given index. +func RegisterDataProxy() *cobra.Command { + // TODO + cmd := &cobra.Command{ + Use: "register [thing]", + Short: "Register a data proxy using a signed message generated with the data-proxy cli", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + // TODO + msg := &types.MsgRegisterDataProxy{} + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// TODO Edit tx diff --git a/x/data-proxy/keeper/common_test.go b/x/data-proxy/keeper/common_test.go new file mode 100644 index 00000000..614ce257 --- /dev/null +++ b/x/data-proxy/keeper/common_test.go @@ -0,0 +1,26 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/keeper" +) + +type KeeperTestSuite struct { + suite.Suite + ctx sdk.Context + keeper *keeper.Keeper +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (s *KeeperTestSuite) SetupTest() { + t := s.T() + t.Helper() +} diff --git a/x/data-proxy/keeper/genesis.go b/x/data-proxy/keeper/genesis.go new file mode 100644 index 00000000..cee05d34 --- /dev/null +++ b/x/data-proxy/keeper/genesis.go @@ -0,0 +1,21 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +// InitGenesis initializes the store based on the given genesis state. +func (k Keeper) InitGenesis(_ sdk.Context, _ types.GenesisState) { + // TODO +} + +// ExportGenesis extracts all data from store to genesis state. +func (k Keeper) ExportGenesis(_ sdk.Context) types.GenesisState { + var gs types.GenesisState + + // TODO + + return gs +} diff --git a/x/data-proxy/keeper/genesis_test.go b/x/data-proxy/keeper/genesis_test.go new file mode 100644 index 00000000..c4c36a99 --- /dev/null +++ b/x/data-proxy/keeper/genesis_test.go @@ -0,0 +1,13 @@ +package keeper_test + +import ( + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +func (s *KeeperTestSuite) TestImportExportGenesis() { + genState := types.GenesisState{} + + s.keeper.InitGenesis(s.ctx, genState) + // exportedGenState := s.keeper.ExportGenesis(s.ctx) + // TODO +} diff --git a/x/data-proxy/keeper/grpc_query.go b/x/data-proxy/keeper/grpc_query.go new file mode 100644 index 00000000..b09ed9d4 --- /dev/null +++ b/x/data-proxy/keeper/grpc_query.go @@ -0,0 +1,21 @@ +package keeper + +import ( + "context" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +var _ types.QueryServer = Querier{} + +type Querier struct { + Keeper +} + +func (q Querier) DataProxyConfig(ctx context.Context, req *types.QueryDataProxyConfigRequest) (*types.QueryDataProxyConfigResponse, error) { + result, err := q.GetDataProxyConfig(ctx, req.PubKey) + if err != nil { + return nil, err + } + return &types.QueryDataProxyConfigResponse{Config: &result}, nil +} diff --git a/x/data-proxy/keeper/grpc_query_test.go b/x/data-proxy/keeper/grpc_query_test.go new file mode 100644 index 00000000..2610cefe --- /dev/null +++ b/x/data-proxy/keeper/grpc_query_test.go @@ -0,0 +1,5 @@ +package keeper_test + +func (s *KeeperTestSuite) TestQuerier_ProxyConfig() { + // TODO +} diff --git a/x/data-proxy/keeper/keeper.go b/x/data-proxy/keeper/keeper.go new file mode 100644 index 00000000..2e783ab5 --- /dev/null +++ b/x/data-proxy/keeper/keeper.go @@ -0,0 +1,59 @@ +package keeper + +import ( + "context" + "encoding/hex" + + "cosmossdk.io/collections" + storetypes "cosmossdk.io/core/store" + "github.com/cosmos/cosmos-sdk/codec" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +type Keeper struct { + // authority is the address capable of executing MsgUpdateParams + // or MsgStoreExecutorWasm. Typically, this should be the gov module + // address. + authority string + + Schema collections.Schema + DataProxyConfigs collections.Map[[]byte, types.ProxyConfig] + // TODO queue + Params collections.Item[types.Params] +} + +func NewKeeper(cdc codec.BinaryCodec, storeService storetypes.KVStoreService, authority string) *Keeper { + sb := collections.NewSchemaBuilder(storeService) + k := Keeper{ + authority: authority, + DataProxyConfigs: collections.NewMap(sb, types.DataProxyConfigPrefix, "configs", collections.BytesKey, codec.CollValue[types.ProxyConfig](cdc)), + Params: collections.NewItem(sb, types.ParamsPrefix, "params", codec.CollValue[types.Params](cdc)), + } + + schema, err := sb.Build() + if err != nil { + panic(err) + } + k.Schema = schema + return &k +} + +// GetAuthority returns the module's authority. +func (k Keeper) GetAuthority() string { + return k.authority +} + +func (k Keeper) GetDataProxyConfig(ctx context.Context, pubKey string) (result types.ProxyConfig, err error) { + pubKeyBytes, err := hex.DecodeString(pubKey) + if err != nil { + return types.ProxyConfig{}, err + } + + config, err := k.DataProxyConfigs.Get(ctx, pubKeyBytes) + if err != nil { + return types.ProxyConfig{}, err + } + + return config, nil +} diff --git a/x/data-proxy/keeper/msg_server.go b/x/data-proxy/keeper/msg_server.go new file mode 100644 index 00000000..dd2ed56c --- /dev/null +++ b/x/data-proxy/keeper/msg_server.go @@ -0,0 +1,52 @@ +package keeper + +import ( + "context" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +type msgServer struct { + Keeper +} + +var _ types.MsgServer = msgServer{} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +func (m msgServer) RegisterDataProxy(_ context.Context, _ *types.MsgRegisterDataProxy) (*types.MsgRegisterDataProxyResponse, error) { + // TODO + return &types.MsgRegisterDataProxyResponse{}, nil +} + +func (m msgServer) EditDataProxy(_ context.Context, _ *types.MsgEditDataProxy) (*types.MsgEditDataProxyResponse, error) { + // TODO + return &types.MsgEditDataProxyResponse{}, nil +} + +func (m msgServer) UpdateParams(goCtx context.Context, req *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if _, err := sdk.AccAddressFromBech32(req.Authority); err != nil { + return nil, fmt.Errorf("invalid authority address: %s", err) + } + if m.GetAuthority() != req.Authority { + return nil, fmt.Errorf("unauthorized authority; expected %s, got %s", m.GetAuthority(), req.Authority) + } + + if err := req.Params.Validate(); err != nil { + return nil, err + } + if err := m.Params.Set(ctx, req.Params); err != nil { + return nil, err + } + + return &types.MsgUpdateParamsResponse{}, nil +} diff --git a/x/data-proxy/keeper/msg_server_test.go b/x/data-proxy/keeper/msg_server_test.go new file mode 100644 index 00000000..ca91bdff --- /dev/null +++ b/x/data-proxy/keeper/msg_server_test.go @@ -0,0 +1,25 @@ +package keeper_test + +import ( + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +func (s *KeeperTestSuite) TestMsgServer_RegisterDataProxy() { + tests := []struct { + name string + msg *types.MsgRegisterDataProxy + valAddrBytes []byte + wantErr error + }{ + { + name: "Happy path", + msg: &types.MsgRegisterDataProxy{}, + wantErr: nil, + }, + } + for _, tt := range tests { + s.Run(tt.name, func() { + // TODO + }) + } +} diff --git a/x/data-proxy/module.go b/x/data-proxy/module.go new file mode 100644 index 00000000..febcbed9 --- /dev/null +++ b/x/data-proxy/module.go @@ -0,0 +1,144 @@ +package dataproxy + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + "cosmossdk.io/core/appmodule" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/sedaprotocol/seda-chain/x/data-proxy/client/cli" + "github.com/sedaprotocol/seda-chain/x/data-proxy/keeper" + "github.com/sedaprotocol/seda-chain/x/data-proxy/types" +) + +var ( + _ module.AppModuleBasic = AppModuleBasic{} + _ appmodule.AppModule = AppModule{} + _ module.HasGenesis = AppModule{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement. +type AppModuleBasic struct { + cdc codec.Codec +} + +func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the appmodule.AppModule interface. +func (am AppModule) IsAppModule() {} + +// Name returns the name of the module as a string +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns a default GenesisState for the module, marshaled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the wasm-storage module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return types.ValidateGenesis(data) +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +// RegisterServices registers a gRPC query service to respond to the module-specific gRPC queries +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: am.keeper}) +} + +// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the module's genesis initialization. It returns no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(gs, &genesisState) + am.keeper.InitGenesis(ctx, genesisState) +} + +// ExportGenesis returns the module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(&gs) +} + +// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock contains the logic that is automatically triggered at the beginning of each block +func (am AppModule) BeginBlock(_ context.Context) error { + return nil +} + +// EndBlock returns the end block logic for the wasm-storage module. +func (am AppModule) EndBlock(_ context.Context) error { + return nil +} diff --git a/x/data-proxy/types/codec.go b/x/data-proxy/types/codec.go new file mode 100644 index 00000000..038c5582 --- /dev/null +++ b/x/data-proxy/types/codec.go @@ -0,0 +1,18 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(_ *codec.LegacyAmino) { +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgRegisterDataProxy{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/data-proxy/types/data_proxy_registry.pb.go b/x/data-proxy/types/data_proxy_registry.pb.go new file mode 100644 index 00000000..4f91cf8a --- /dev/null +++ b/x/data-proxy/types/data_proxy_registry.pb.go @@ -0,0 +1,906 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sedachain/data_proxy_registry/v1/data_proxy_registry.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Module parameters which can be changed through governance. +type Params struct { + // min_fee_update_delay is the minimum number of blocks after which a fee + // update comes into effect. + MinFeeUpdateDelay uint32 `protobuf:"varint,1,opt,name=min_fee_update_delay,json=minFeeUpdateDelay,proto3" json:"min_fee_update_delay,omitempty"` +} + +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_8aeb6ee007ac916d, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMinFeeUpdateDelay() uint32 { + if m != nil { + return m.MinFeeUpdateDelay + } + return 0 +} + +// ProxyConfig defines a data-proxy entry in the registry. +type ProxyConfig struct { + // payout_address defines the address to which the data proxy fees should be + // transferred. + PayoutAddress string `protobuf:"bytes,1,opt,name=payout_address,json=payoutAddress,proto3" json:"payout_address,omitempty"` + // fee defines the amount in aseda this data-proxy charges when utilised. + Fee *types.Coin `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee,omitempty"` + // memo defines an optional string which is not used by the protocol. + Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` + // fee_update defines an upcoming fee change which will take effect at a + // future height. + FeeUpdate *FeeUpdate `protobuf:"bytes,4,opt,name=fee_update,json=feeUpdate,proto3" json:"fee_update,omitempty"` +} + +func (m *ProxyConfig) Reset() { *m = ProxyConfig{} } +func (m *ProxyConfig) String() string { return proto.CompactTextString(m) } +func (*ProxyConfig) ProtoMessage() {} +func (*ProxyConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_8aeb6ee007ac916d, []int{1} +} +func (m *ProxyConfig) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProxyConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProxyConfig.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 *ProxyConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProxyConfig.Merge(m, src) +} +func (m *ProxyConfig) XXX_Size() int { + return m.Size() +} +func (m *ProxyConfig) XXX_DiscardUnknown() { + xxx_messageInfo_ProxyConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_ProxyConfig proto.InternalMessageInfo + +func (m *ProxyConfig) GetPayoutAddress() string { + if m != nil { + return m.PayoutAddress + } + return "" +} + +func (m *ProxyConfig) GetFee() *types.Coin { + if m != nil { + return m.Fee + } + return nil +} + +func (m *ProxyConfig) GetMemo() string { + if m != nil { + return m.Memo + } + return "" +} + +func (m *ProxyConfig) GetFeeUpdate() *FeeUpdate { + if m != nil { + return m.FeeUpdate + } + return nil +} + +// FeeUpdate defines a new fee amount and the height at which it will take +// effect. +type FeeUpdate struct { + // new_fee defines the new fee for the data proxy. + NewFee types.Coin `protobuf:"bytes,1,opt,name=new_fee,json=newFee,proto3" json:"new_fee"` + // update_height defines the height at which the new fee comes into effect. + UpdateHeight int64 `protobuf:"varint,2,opt,name=update_height,json=updateHeight,proto3" json:"update_height,omitempty"` +} + +func (m *FeeUpdate) Reset() { *m = FeeUpdate{} } +func (m *FeeUpdate) String() string { return proto.CompactTextString(m) } +func (*FeeUpdate) ProtoMessage() {} +func (*FeeUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_8aeb6ee007ac916d, []int{2} +} +func (m *FeeUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FeeUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FeeUpdate.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 *FeeUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_FeeUpdate.Merge(m, src) +} +func (m *FeeUpdate) XXX_Size() int { + return m.Size() +} +func (m *FeeUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_FeeUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_FeeUpdate proto.InternalMessageInfo + +func (m *FeeUpdate) GetNewFee() types.Coin { + if m != nil { + return m.NewFee + } + return types.Coin{} +} + +func (m *FeeUpdate) GetUpdateHeight() int64 { + if m != nil { + return m.UpdateHeight + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "sedachain.data_proxy_registry.v1.Params") + proto.RegisterType((*ProxyConfig)(nil), "sedachain.data_proxy_registry.v1.ProxyConfig") + proto.RegisterType((*FeeUpdate)(nil), "sedachain.data_proxy_registry.v1.FeeUpdate") +} + +func init() { + proto.RegisterFile("sedachain/data_proxy_registry/v1/data_proxy_registry.proto", fileDescriptor_8aeb6ee007ac916d) +} + +var fileDescriptor_8aeb6ee007ac916d = []byte{ + // 431 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xcd, 0x92, 0x28, 0x28, 0x5b, 0x82, 0xc4, 0x2a, 0x07, 0xb7, 0x07, 0x37, 0x0a, 0x97, 0x4a, + 0x55, 0x76, 0x15, 0xb8, 0xa0, 0x1e, 0xa8, 0x48, 0x51, 0xc5, 0x31, 0x32, 0x42, 0x42, 0x5c, 0xac, + 0x8d, 0x3d, 0xb6, 0x17, 0xd5, 0xbb, 0x96, 0x77, 0x93, 0xd6, 0x7f, 0xc1, 0x27, 0xf0, 0x11, 0x7c, + 0x44, 0x8f, 0x15, 0x27, 0x4e, 0x08, 0x92, 0x0b, 0x9f, 0x81, 0x76, 0xd7, 0x98, 0x4b, 0x05, 0xb7, + 0x9d, 0xf7, 0xe6, 0x8d, 0xdf, 0x1b, 0x0f, 0x3e, 0xd3, 0x90, 0xf2, 0xa4, 0xe0, 0x42, 0xb2, 0x94, + 0x1b, 0x1e, 0x57, 0xb5, 0xba, 0x69, 0xe2, 0x1a, 0x72, 0xa1, 0x4d, 0xdd, 0xb0, 0xed, 0xe2, 0x3e, + 0x98, 0x56, 0xb5, 0x32, 0x8a, 0x4c, 0x3b, 0x2d, 0xbd, 0xaf, 0x69, 0xbb, 0x38, 0x9a, 0xe4, 0x2a, + 0x57, 0xae, 0x99, 0xd9, 0x97, 0xd7, 0x1d, 0x1d, 0x26, 0x4a, 0x97, 0x4a, 0xc7, 0x9e, 0xf0, 0x45, + 0x4b, 0x85, 0xbe, 0x62, 0x6b, 0xae, 0x81, 0x6d, 0x17, 0x6b, 0x30, 0x7c, 0xc1, 0x12, 0x25, 0xa4, + 0xe7, 0x67, 0xe7, 0x78, 0xb8, 0xe2, 0x35, 0x2f, 0x35, 0x61, 0x78, 0x52, 0x0a, 0x19, 0x67, 0x00, + 0xf1, 0xa6, 0x4a, 0xb9, 0x81, 0x38, 0x85, 0x2b, 0xde, 0x04, 0x68, 0x8a, 0x4e, 0xc6, 0xd1, 0x93, + 0x52, 0xc8, 0x4b, 0x80, 0x77, 0x8e, 0x79, 0x6d, 0x89, 0xb3, 0xc1, 0xaf, 0xcf, 0xc7, 0x68, 0xf6, + 0x13, 0xe1, 0x83, 0x95, 0xf5, 0x79, 0xa1, 0x64, 0x26, 0x72, 0x72, 0x8e, 0x1f, 0x57, 0xbc, 0x51, + 0x1b, 0x13, 0xf3, 0x34, 0xad, 0x41, 0x6b, 0x37, 0x60, 0xb4, 0x0c, 0xbe, 0x7e, 0x99, 0x4f, 0x5a, + 0x6b, 0xaf, 0x3c, 0xf3, 0xd6, 0xd4, 0x42, 0xe6, 0xd1, 0xd8, 0xf7, 0xb7, 0x20, 0x39, 0xc5, 0xfd, + 0x0c, 0x20, 0x78, 0x30, 0x45, 0x27, 0x07, 0xcf, 0x0e, 0x69, 0x2b, 0xb1, 0xfe, 0x69, 0xeb, 0x9f, + 0x5e, 0x28, 0x21, 0x23, 0xdb, 0x45, 0x08, 0x1e, 0x94, 0x50, 0xaa, 0xa0, 0x6f, 0xbf, 0x11, 0xb9, + 0x37, 0x59, 0x61, 0xfc, 0x37, 0x44, 0x30, 0x70, 0x73, 0x4e, 0xe9, 0xff, 0x56, 0x4b, 0xbb, 0x74, + 0xcb, 0xc1, 0xed, 0xf7, 0x63, 0x14, 0x8d, 0xb2, 0x3f, 0xc0, 0xec, 0x23, 0x1e, 0x75, 0x2c, 0x79, + 0x81, 0x1f, 0x4a, 0xb8, 0xb6, 0x7b, 0x72, 0xc9, 0xfe, 0xe5, 0xd1, 0x4d, 0xea, 0x45, 0x43, 0x09, + 0xd7, 0x97, 0x00, 0xe4, 0x29, 0x1e, 0xb7, 0x9b, 0x2d, 0x40, 0xe4, 0x85, 0x71, 0x19, 0xfb, 0xd1, + 0x23, 0x0f, 0xbe, 0x71, 0xd8, 0xf2, 0xfd, 0xed, 0x2e, 0x44, 0x77, 0xbb, 0x10, 0xfd, 0xd8, 0x85, + 0xe8, 0xd3, 0x3e, 0xec, 0xdd, 0xed, 0xc3, 0xde, 0xb7, 0x7d, 0xd8, 0xfb, 0xf0, 0x32, 0x17, 0xa6, + 0xd8, 0xac, 0x69, 0xa2, 0x4a, 0x66, 0xd3, 0xb8, 0x1f, 0x98, 0xa8, 0x2b, 0x57, 0xcc, 0xfd, 0xc9, + 0xdd, 0xb8, 0xeb, 0x9a, 0xbb, 0x74, 0xf3, 0xee, 0xe8, 0x4c, 0x53, 0x81, 0x5e, 0x0f, 0x9d, 0xe0, + 0xf9, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xc7, 0x1c, 0x74, 0xa2, 0x02, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.MinFeeUpdateDelay != that1.MinFeeUpdateDelay { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MinFeeUpdateDelay != 0 { + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(m.MinFeeUpdateDelay)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ProxyConfig) 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 *ProxyConfig) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProxyConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FeeUpdate != nil { + { + size, err := m.FeeUpdate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Memo) > 0 { + i -= len(m.Memo) + copy(dAtA[i:], m.Memo) + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(len(m.Memo))) + i-- + dAtA[i] = 0x1a + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PayoutAddress) > 0 { + i -= len(m.PayoutAddress) + copy(dAtA[i:], m.PayoutAddress) + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(len(m.PayoutAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FeeUpdate) 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 *FeeUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FeeUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UpdateHeight != 0 { + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(m.UpdateHeight)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.NewFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDataProxyRegistry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintDataProxyRegistry(dAtA []byte, offset int, v uint64) int { + offset -= sovDataProxyRegistry(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MinFeeUpdateDelay != 0 { + n += 1 + sovDataProxyRegistry(uint64(m.MinFeeUpdateDelay)) + } + return n +} + +func (m *ProxyConfig) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PayoutAddress) + if l > 0 { + n += 1 + l + sovDataProxyRegistry(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovDataProxyRegistry(uint64(l)) + } + l = len(m.Memo) + if l > 0 { + n += 1 + l + sovDataProxyRegistry(uint64(l)) + } + if m.FeeUpdate != nil { + l = m.FeeUpdate.Size() + n += 1 + l + sovDataProxyRegistry(uint64(l)) + } + return n +} + +func (m *FeeUpdate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.NewFee.Size() + n += 1 + l + sovDataProxyRegistry(uint64(l)) + if m.UpdateHeight != 0 { + n += 1 + sovDataProxyRegistry(uint64(m.UpdateHeight)) + } + return n +} + +func sovDataProxyRegistry(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDataProxyRegistry(x uint64) (n int) { + return sovDataProxyRegistry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowDataProxyRegistry + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinFeeUpdateDelay", wireType) + } + m.MinFeeUpdateDelay = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinFeeUpdateDelay |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDataProxyRegistry(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ProxyConfig) 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 ErrIntOverflowDataProxyRegistry + } + 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: ProxyConfig: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProxyConfig: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayoutAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + 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 ErrInvalidLengthDataProxyRegistry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PayoutAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDataProxyRegistry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &types.Coin{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + 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 ErrInvalidLengthDataProxyRegistry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Memo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeUpdate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDataProxyRegistry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FeeUpdate == nil { + m.FeeUpdate = &FeeUpdate{} + } + if err := m.FeeUpdate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDataProxyRegistry(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FeeUpdate) 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 ErrIntOverflowDataProxyRegistry + } + 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: FeeUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeeUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDataProxyRegistry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NewFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdateHeight", wireType) + } + m.UpdateHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDataProxyRegistry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UpdateHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDataProxyRegistry(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDataProxyRegistry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDataProxyRegistry(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, ErrIntOverflowDataProxyRegistry + } + 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, ErrIntOverflowDataProxyRegistry + } + 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, ErrIntOverflowDataProxyRegistry + } + 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, ErrInvalidLengthDataProxyRegistry + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupDataProxyRegistry + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthDataProxyRegistry + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthDataProxyRegistry = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDataProxyRegistry = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupDataProxyRegistry = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/data-proxy/types/errors.go b/x/data-proxy/types/errors.go new file mode 100644 index 00000000..b340aba3 --- /dev/null +++ b/x/data-proxy/types/errors.go @@ -0,0 +1,8 @@ +package types + +import "cosmossdk.io/errors" + +var ( + ErrEmptyValue = errors.Register(ModuleName, 1, "empty value") + ErrInvalidParam = errors.Register(ModuleName, 2, "invalid parameter") +) diff --git a/x/data-proxy/types/events.go b/x/data-proxy/types/events.go new file mode 100644 index 00000000..493adc00 --- /dev/null +++ b/x/data-proxy/types/events.go @@ -0,0 +1,5 @@ +package types + +const ( + EventTypeRegisterProxy = "register_proxy" +) diff --git a/x/data-proxy/types/genesis.go b/x/data-proxy/types/genesis.go new file mode 100644 index 00000000..a63b6eca --- /dev/null +++ b/x/data-proxy/types/genesis.go @@ -0,0 +1,14 @@ +package types + +func NewGenesisState() GenesisState { + return GenesisState{} +} + +func DefaultGenesisState() *GenesisState { + state := NewGenesisState() + return &state +} + +func ValidateGenesis(_ GenesisState) error { + return nil +} diff --git a/x/data-proxy/types/genesis.pb.go b/x/data-proxy/types/genesis.pb.go new file mode 100644 index 00000000..1d789c8d --- /dev/null +++ b/x/data-proxy/types/genesis.pb.go @@ -0,0 +1,896 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sedachain/data_proxy_registry/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines data_proxy_registry module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + DataProxyConfigs []DataProxyConfigs `protobuf:"bytes,2,rep,name=data_proxy_configs,json=dataProxyConfigs,proto3" json:"data_proxy_configs"` + FeeUpdateQueue []FeeUpdateQueueRecord `protobuf:"bytes,3,rep,name=fee_update_queue,json=feeUpdateQueue,proto3" json:"fee_update_queue"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_a83a96e2b6d92541, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetDataProxyConfigs() []DataProxyConfigs { + if m != nil { + return m.DataProxyConfigs + } + return nil +} + +func (m *GenesisState) GetFeeUpdateQueue() []FeeUpdateQueueRecord { + if m != nil { + return m.FeeUpdateQueue + } + return nil +} + +// DataProxyConfigs define the data proxy entries in the registry. +type DataProxyConfigs struct { + DataProxyPubkey string `protobuf:"bytes,1,opt,name=data_proxy_pubkey,json=dataProxyPubkey,proto3" json:"data_proxy_pubkey,omitempty"` + Config *ProxyConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"` +} + +func (m *DataProxyConfigs) Reset() { *m = DataProxyConfigs{} } +func (m *DataProxyConfigs) String() string { return proto.CompactTextString(m) } +func (*DataProxyConfigs) ProtoMessage() {} +func (*DataProxyConfigs) Descriptor() ([]byte, []int) { + return fileDescriptor_a83a96e2b6d92541, []int{1} +} +func (m *DataProxyConfigs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DataProxyConfigs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DataProxyConfigs.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 *DataProxyConfigs) XXX_Merge(src proto.Message) { + xxx_messageInfo_DataProxyConfigs.Merge(m, src) +} +func (m *DataProxyConfigs) XXX_Size() int { + return m.Size() +} +func (m *DataProxyConfigs) XXX_DiscardUnknown() { + xxx_messageInfo_DataProxyConfigs.DiscardUnknown(m) +} + +var xxx_messageInfo_DataProxyConfigs proto.InternalMessageInfo + +func (m *DataProxyConfigs) GetDataProxyPubkey() string { + if m != nil { + return m.DataProxyPubkey + } + return "" +} + +func (m *DataProxyConfigs) GetConfig() *ProxyConfig { + if m != nil { + return m.Config + } + return nil +} + +// FeeUpdateQueueRecord defines an entry in the data proxy update queue. +type FeeUpdateQueueRecord struct { + DataProxyPubkey string `protobuf:"bytes,1,opt,name=data_proxy_pubkey,json=dataProxyPubkey,proto3" json:"data_proxy_pubkey,omitempty"` + UpdateHeight int64 `protobuf:"varint,2,opt,name=update_height,json=updateHeight,proto3" json:"update_height,omitempty"` +} + +func (m *FeeUpdateQueueRecord) Reset() { *m = FeeUpdateQueueRecord{} } +func (m *FeeUpdateQueueRecord) String() string { return proto.CompactTextString(m) } +func (*FeeUpdateQueueRecord) ProtoMessage() {} +func (*FeeUpdateQueueRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_a83a96e2b6d92541, []int{2} +} +func (m *FeeUpdateQueueRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FeeUpdateQueueRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FeeUpdateQueueRecord.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 *FeeUpdateQueueRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_FeeUpdateQueueRecord.Merge(m, src) +} +func (m *FeeUpdateQueueRecord) XXX_Size() int { + return m.Size() +} +func (m *FeeUpdateQueueRecord) XXX_DiscardUnknown() { + xxx_messageInfo_FeeUpdateQueueRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_FeeUpdateQueueRecord proto.InternalMessageInfo + +func (m *FeeUpdateQueueRecord) GetDataProxyPubkey() string { + if m != nil { + return m.DataProxyPubkey + } + return "" +} + +func (m *FeeUpdateQueueRecord) GetUpdateHeight() int64 { + if m != nil { + return m.UpdateHeight + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "sedachain.data_proxy_registry.v1.GenesisState") + proto.RegisterType((*DataProxyConfigs)(nil), "sedachain.data_proxy_registry.v1.DataProxyConfigs") + proto.RegisterType((*FeeUpdateQueueRecord)(nil), "sedachain.data_proxy_registry.v1.FeeUpdateQueueRecord") +} + +func init() { + proto.RegisterFile("sedachain/data_proxy_registry/v1/genesis.proto", fileDescriptor_a83a96e2b6d92541) +} + +var fileDescriptor_a83a96e2b6d92541 = []byte{ + // 391 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x41, 0x6f, 0xa2, 0x50, + 0x18, 0x04, 0xdd, 0x98, 0xec, 0xd3, 0xdd, 0x75, 0x89, 0x07, 0xe2, 0x81, 0x35, 0xee, 0xc5, 0x6c, + 0x02, 0x44, 0x37, 0xd9, 0xc3, 0x1e, 0xf6, 0xe0, 0xb6, 0xb6, 0x47, 0x4b, 0xd3, 0xa4, 0xe9, 0x85, + 0x3c, 0xe1, 0xe3, 0x41, 0x5a, 0x7d, 0x14, 0x1e, 0x46, 0x7e, 0x40, 0xef, 0xfd, 0x15, 0xfd, 0x2d, + 0x1e, 0x3d, 0xf6, 0xd4, 0x34, 0xfa, 0x47, 0x1a, 0x3e, 0x88, 0xb5, 0xc6, 0x84, 0xf6, 0x06, 0xc3, + 0xcc, 0x37, 0xc3, 0x64, 0x88, 0x11, 0x83, 0x4b, 0x1d, 0x9f, 0x06, 0x33, 0xd3, 0xa5, 0x82, 0xda, + 0x61, 0xc4, 0x17, 0xa9, 0x1d, 0x01, 0x0b, 0x62, 0x11, 0xa5, 0xe6, 0xbc, 0x6f, 0x32, 0x98, 0x41, + 0x1c, 0xc4, 0x46, 0x18, 0x71, 0xc1, 0x95, 0xce, 0x96, 0x6f, 0x1c, 0xe0, 0x1b, 0xf3, 0x7e, 0xbb, + 0xc5, 0x38, 0xe3, 0x48, 0x36, 0xb3, 0xa7, 0x5c, 0xd7, 0xfe, 0x5b, 0xea, 0x73, 0xe8, 0x1c, 0x6a, + 0xbb, 0x0f, 0x15, 0xd2, 0x38, 0xc9, 0x53, 0x9c, 0x0b, 0x2a, 0x40, 0x19, 0x91, 0x5a, 0x48, 0x23, + 0x3a, 0x8d, 0x55, 0xb9, 0x23, 0xf7, 0xea, 0x83, 0x9e, 0x51, 0x96, 0xca, 0x18, 0x23, 0x7f, 0xf8, + 0x69, 0xf9, 0xf4, 0x43, 0xb2, 0x0a, 0xb5, 0xe2, 0x11, 0x65, 0x87, 0xee, 0xf0, 0x99, 0x17, 0xb0, + 0x58, 0xad, 0x74, 0xaa, 0xbd, 0xfa, 0x60, 0x50, 0x7e, 0xf3, 0x88, 0x0a, 0x3a, 0xce, 0xd0, 0xff, + 0xb9, 0xb2, 0xb8, 0xde, 0x74, 0xf7, 0x70, 0xc5, 0x23, 0x4d, 0x0f, 0xc0, 0x4e, 0x42, 0x97, 0x0a, + 0xb0, 0x6f, 0x13, 0x48, 0x40, 0xad, 0xa2, 0xcb, 0x9f, 0x72, 0x97, 0x11, 0xc0, 0x05, 0x0a, 0xcf, + 0x32, 0x9d, 0x05, 0x0e, 0x8f, 0xdc, 0xc2, 0xe9, 0xab, 0xf7, 0xe6, 0x5b, 0xf7, 0x4e, 0x26, 0xcd, + 0xfd, 0x50, 0xca, 0x2f, 0xf2, 0x7d, 0xe7, 0x72, 0x98, 0x4c, 0xae, 0x21, 0xc5, 0xde, 0x3e, 0x5b, + 0xdf, 0xb6, 0x49, 0xc7, 0x08, 0x2b, 0xc7, 0xa4, 0x96, 0xb7, 0xa0, 0x56, 0xb0, 0x58, 0xfd, 0x1d, + 0xc5, 0xbe, 0x7a, 0x59, 0x85, 0xb8, 0xcb, 0x48, 0xeb, 0x50, 0xea, 0x0f, 0x45, 0xf9, 0x49, 0xbe, + 0x14, 0x7d, 0xf9, 0x10, 0x30, 0x5f, 0x60, 0xa2, 0xaa, 0xd5, 0xc8, 0xc1, 0x53, 0xc4, 0x86, 0x97, + 0xcb, 0xb5, 0x26, 0xaf, 0xd6, 0x9a, 0xfc, 0xbc, 0xd6, 0xe4, 0xfb, 0x8d, 0x26, 0xad, 0x36, 0x9a, + 0xf4, 0xb8, 0xd1, 0xa4, 0xab, 0x7f, 0x2c, 0x10, 0x7e, 0x32, 0x31, 0x1c, 0x3e, 0x35, 0xb3, 0x7f, + 0xc0, 0x25, 0x39, 0xfc, 0x06, 0x5f, 0xf4, 0x7c, 0x88, 0x0b, 0xdc, 0x9c, 0x8e, 0x69, 0xf4, 0xed, + 0x14, 0x45, 0x1a, 0x42, 0x3c, 0xa9, 0xa1, 0xe0, 0xf7, 0x4b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x23, + 0xeb, 0xc5, 0xe9, 0x20, 0x03, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeUpdateQueue) > 0 { + for iNdEx := len(m.FeeUpdateQueue) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeUpdateQueue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.DataProxyConfigs) > 0 { + for iNdEx := len(m.DataProxyConfigs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataProxyConfigs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *DataProxyConfigs) 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 *DataProxyConfigs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DataProxyConfigs) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DataProxyPubkey) > 0 { + i -= len(m.DataProxyPubkey) + copy(dAtA[i:], m.DataProxyPubkey) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.DataProxyPubkey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *FeeUpdateQueueRecord) 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 *FeeUpdateQueueRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FeeUpdateQueueRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UpdateHeight != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.UpdateHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.DataProxyPubkey) > 0 { + i -= len(m.DataProxyPubkey) + copy(dAtA[i:], m.DataProxyPubkey) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.DataProxyPubkey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.DataProxyConfigs) > 0 { + for _, e := range m.DataProxyConfigs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.FeeUpdateQueue) > 0 { + for _, e := range m.FeeUpdateQueue { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *DataProxyConfigs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DataProxyPubkey) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.Config != nil { + l = m.Config.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *FeeUpdateQueueRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DataProxyPubkey) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + if m.UpdateHeight != 0 { + n += 1 + sovGenesis(uint64(m.UpdateHeight)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataProxyConfigs", 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.DataProxyConfigs = append(m.DataProxyConfigs, DataProxyConfigs{}) + if err := m.DataProxyConfigs[len(m.DataProxyConfigs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeUpdateQueue", 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.FeeUpdateQueue = append(m.FeeUpdateQueue, FeeUpdateQueueRecord{}) + if err := m.FeeUpdateQueue[len(m.FeeUpdateQueue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DataProxyConfigs) 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 ErrIntOverflowGenesis + } + 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: DataProxyConfigs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DataProxyConfigs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataProxyPubkey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataProxyPubkey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", 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 + } + if m.Config == nil { + m.Config = &ProxyConfig{} + } + if err := m.Config.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FeeUpdateQueueRecord) 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 ErrIntOverflowGenesis + } + 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: FeeUpdateQueueRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeeUpdateQueueRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataProxyPubkey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataProxyPubkey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdateHeight", wireType) + } + m.UpdateHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UpdateHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/data-proxy/types/keys.go b/x/data-proxy/types/keys.go new file mode 100644 index 00000000..5ccc84dd --- /dev/null +++ b/x/data-proxy/types/keys.go @@ -0,0 +1,13 @@ +package types + +import "cosmossdk.io/collections" + +const ( + ModuleName = "data-proxy" + StoreKey +) + +var ( + DataProxyConfigPrefix = collections.NewPrefix(0) + ParamsPrefix = collections.NewPrefix(3) +) diff --git a/x/data-proxy/types/params.go b/x/data-proxy/types/params.go new file mode 100644 index 00000000..4cc46215 --- /dev/null +++ b/x/data-proxy/types/params.go @@ -0,0 +1,25 @@ +package types + +import ( + "cosmossdk.io/errors" +) + +const ( + DefaultMinFeeUpdateDelay uint32 = 86400 // Roughly 1 week with a ~7 sec block time +) + +// DefaultParams returns default wasm-storage module parameters. +func DefaultParams() Params { + return Params{ + MinFeeUpdateDelay: DefaultMinFeeUpdateDelay, + } +} + +// ValidateBasic performs basic validation on wasm-storage +// module parameters. +func (p *Params) Validate() error { + if p.MinFeeUpdateDelay < 1 { + return errors.Wrapf(ErrInvalidParam, "MinFeeUpdateDelay %d < 1", p.MinFeeUpdateDelay) + } + return nil +} diff --git a/x/data-proxy/types/query.pb.go b/x/data-proxy/types/query.pb.go new file mode 100644 index 00000000..80bc09d7 --- /dev/null +++ b/x/data-proxy/types/query.pb.go @@ -0,0 +1,600 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sedachain/data_proxy_registry/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + 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 + +// The request message for QueryDataProxyConfig RPC method. +type QueryDataProxyConfigRequest struct { + // A hex encoded string of the public key of the data proxy. + PubKey string `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` +} + +func (m *QueryDataProxyConfigRequest) Reset() { *m = QueryDataProxyConfigRequest{} } +func (m *QueryDataProxyConfigRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDataProxyConfigRequest) ProtoMessage() {} +func (*QueryDataProxyConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_eb9f82df44af8fdc, []int{0} +} +func (m *QueryDataProxyConfigRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDataProxyConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDataProxyConfigRequest.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 *QueryDataProxyConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDataProxyConfigRequest.Merge(m, src) +} +func (m *QueryDataProxyConfigRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDataProxyConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDataProxyConfigRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDataProxyConfigRequest proto.InternalMessageInfo + +func (m *QueryDataProxyConfigRequest) GetPubKey() string { + if m != nil { + return m.PubKey + } + return "" +} + +// The response message for QueryDataProxyConfig RPC method. +type QueryDataProxyConfigResponse struct { + Config *ProxyConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"` +} + +func (m *QueryDataProxyConfigResponse) Reset() { *m = QueryDataProxyConfigResponse{} } +func (m *QueryDataProxyConfigResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDataProxyConfigResponse) ProtoMessage() {} +func (*QueryDataProxyConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_eb9f82df44af8fdc, []int{1} +} +func (m *QueryDataProxyConfigResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDataProxyConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDataProxyConfigResponse.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 *QueryDataProxyConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDataProxyConfigResponse.Merge(m, src) +} +func (m *QueryDataProxyConfigResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDataProxyConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDataProxyConfigResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDataProxyConfigResponse proto.InternalMessageInfo + +func (m *QueryDataProxyConfigResponse) GetConfig() *ProxyConfig { + if m != nil { + return m.Config + } + return nil +} + +func init() { + proto.RegisterType((*QueryDataProxyConfigRequest)(nil), "sedachain.data_proxy_registry.v1.QueryDataProxyConfigRequest") + proto.RegisterType((*QueryDataProxyConfigResponse)(nil), "sedachain.data_proxy_registry.v1.QueryDataProxyConfigResponse") +} + +func init() { + proto.RegisterFile("sedachain/data_proxy_registry/v1/query.proto", fileDescriptor_eb9f82df44af8fdc) +} + +var fileDescriptor_eb9f82df44af8fdc = []byte{ + // 322 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x29, 0x4e, 0x4d, 0x49, + 0x4c, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0x4f, 0x49, 0x2c, 0x49, 0x8c, 0x2f, 0x28, 0xca, 0xaf, 0xa8, + 0x8c, 0x2f, 0x4a, 0x4d, 0xcf, 0x2c, 0x2e, 0x29, 0xaa, 0xd4, 0x2f, 0x33, 0xd4, 0x2f, 0x2c, 0x4d, + 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x80, 0xab, 0xd6, 0xc3, 0xa2, 0x5a, + 0xaf, 0xcc, 0x50, 0x4a, 0x26, 0x3d, 0x3f, 0x3f, 0x3d, 0x27, 0x55, 0x3f, 0xb1, 0x20, 0x53, 0x3f, + 0x31, 0x2f, 0x2f, 0xbf, 0x24, 0xb1, 0x24, 0x33, 0x3f, 0xaf, 0x18, 0xa2, 0x5f, 0xca, 0x8a, 0xa0, + 0x6d, 0xd8, 0x8c, 0x05, 0xeb, 0x55, 0x32, 0xe3, 0x92, 0x0e, 0x04, 0x39, 0xc5, 0x25, 0xb1, 0x24, + 0x31, 0x00, 0xa4, 0xc0, 0x39, 0x3f, 0x2f, 0x2d, 0x33, 0x3d, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, + 0x44, 0x48, 0x9c, 0x8b, 0xbd, 0xa0, 0x34, 0x29, 0x3e, 0x3b, 0xb5, 0x52, 0x82, 0x51, 0x81, 0x51, + 0x83, 0x33, 0x88, 0xad, 0xa0, 0x34, 0xc9, 0x3b, 0xb5, 0x52, 0x29, 0x95, 0x4b, 0x06, 0xbb, 0xbe, + 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x57, 0x2e, 0xb6, 0x64, 0xb0, 0x08, 0x58, 0x1f, 0xb7, + 0x91, 0xae, 0x1e, 0x21, 0x4f, 0xea, 0x21, 0x1b, 0x03, 0xd5, 0x6c, 0x74, 0x83, 0x91, 0x8b, 0x15, + 0x6c, 0x8f, 0xd0, 0x39, 0x46, 0x2e, 0x7e, 0x34, 0xcb, 0x84, 0x6c, 0x09, 0x1b, 0x8a, 0xc7, 0x73, + 0x52, 0x76, 0xe4, 0x6a, 0x87, 0xf8, 0x51, 0xc9, 0xa6, 0xe9, 0xf2, 0x93, 0xc9, 0x4c, 0x66, 0x42, + 0x26, 0xfa, 0x20, 0x73, 0x74, 0x11, 0x31, 0xa0, 0x0b, 0x36, 0x48, 0x17, 0x1e, 0x03, 0x08, 0x31, + 0xfd, 0x6a, 0x68, 0x70, 0xd6, 0x3a, 0x45, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, + 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, + 0x43, 0x94, 0x5d, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0xd8, 0x64, 0x70, + 0x4c, 0x25, 0xe7, 0xe7, 0x20, 0x5b, 0x53, 0x81, 0xd5, 0xa2, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, + 0x36, 0xb0, 0x06, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, 0x0d, 0xa6, 0x83, 0x86, 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 { + // DataProxyConfig returns a data proxy config when given its public key as a + // hex encoded string. + DataProxyConfig(ctx context.Context, in *QueryDataProxyConfigRequest, opts ...grpc.CallOption) (*QueryDataProxyConfigResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) DataProxyConfig(ctx context.Context, in *QueryDataProxyConfigRequest, opts ...grpc.CallOption) (*QueryDataProxyConfigResponse, error) { + out := new(QueryDataProxyConfigResponse) + err := c.cc.Invoke(ctx, "/sedachain.data_proxy_registry.v1.Query/DataProxyConfig", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // DataProxyConfig returns a data proxy config when given its public key as a + // hex encoded string. + DataProxyConfig(context.Context, *QueryDataProxyConfigRequest) (*QueryDataProxyConfigResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) DataProxyConfig(ctx context.Context, req *QueryDataProxyConfigRequest) (*QueryDataProxyConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DataProxyConfig not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_DataProxyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDataProxyConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DataProxyConfig(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sedachain.data_proxy_registry.v1.Query/DataProxyConfig", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DataProxyConfig(ctx, req.(*QueryDataProxyConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Query_serviceDesc = _Query_serviceDesc +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "sedachain.data_proxy_registry.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "DataProxyConfig", + Handler: _Query_DataProxyConfig_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sedachain/data_proxy_registry/v1/query.proto", +} + +func (m *QueryDataProxyConfigRequest) 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 *QueryDataProxyConfigRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDataProxyConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PubKey) > 0 { + i -= len(m.PubKey) + copy(dAtA[i:], m.PubKey) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PubKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDataProxyConfigResponse) 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 *QueryDataProxyConfigResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDataProxyConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Config != nil { + { + size, err := m.Config.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 *QueryDataProxyConfigRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PubKey) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDataProxyConfigResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Config != nil { + l = m.Config.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 *QueryDataProxyConfigRequest) 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: QueryDataProxyConfigRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDataProxyConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", 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.PubKey = string(dAtA[iNdEx:postIndex]) + 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 (m *QueryDataProxyConfigResponse) 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: QueryDataProxyConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDataProxyConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Config", 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.Config == nil { + m.Config = &ProxyConfig{} + } + if err := m.Config.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 + 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/x/data-proxy/types/query.pb.gw.go b/x/data-proxy/types/query.pb.gw.go new file mode 100644 index 00000000..1a0c9c87 --- /dev/null +++ b/x/data-proxy/types/query.pb.gw.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: sedachain/data_proxy_registry/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_DataProxyConfig_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDataProxyConfigRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pub_key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pub_key") + } + + protoReq.PubKey, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) + } + + msg, err := client.DataProxyConfig(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DataProxyConfig_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDataProxyConfigRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pub_key"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pub_key") + } + + protoReq.PubKey, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pub_key", err) + } + + msg, err := server.DataProxyConfig(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. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_DataProxyConfig_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_DataProxyConfig_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_DataProxyConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_DataProxyConfig_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_DataProxyConfig_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_DataProxyConfig_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_DataProxyConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"seda-chain", "data-proxy", "data-proxy", "pub_key"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_DataProxyConfig_0 = runtime.ForwardResponseMessage +) diff --git a/x/data-proxy/types/tx.go b/x/data-proxy/types/tx.go new file mode 100644 index 00000000..2fa5bfa9 --- /dev/null +++ b/x/data-proxy/types/tx.go @@ -0,0 +1,31 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (m *MsgRegisterDataProxy) Validate() error { + if m.PayoutAddress == "" { + return ErrEmptyValue.Wrap("empty payout address") + } + if _, err := sdk.AccAddressFromBech32(m.PayoutAddress); err != nil { + return err + } + if m.PubKey == nil { + return ErrEmptyValue.Wrap("empty public key") + } + if m.Fee == nil { + return ErrEmptyValue.Wrap("empty fee") + } + if m.Signature == nil { + return ErrEmptyValue.Wrap("empty signature") + } + return nil +} + +// TODO edit message + +func (m *MsgUpdateParams) Validate() error { + // TODO + return nil +} diff --git a/x/data-proxy/types/tx.pb.go b/x/data-proxy/types/tx.pb.go new file mode 100644 index 00000000..ea458881 --- /dev/null +++ b/x/data-proxy/types/tx.pb.go @@ -0,0 +1,1796 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: sedachain/data_proxy_registry/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types1 "github.com/cosmos/cosmos-sdk/codec/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// All data required for a new data proxy. +type MsgRegisterDataProxy struct { + PayoutAddress string `protobuf:"bytes,1,opt,name=payout_address,json=payoutAddress,proto3" json:"payout_address,omitempty"` + Fee *types.Coin `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee,omitempty"` + Memo string `protobuf:"bytes,3,opt,name=memo,proto3" json:"memo,omitempty"` + PubKey *types1.Any `protobuf:"bytes,4,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgRegisterDataProxy) Reset() { *m = MsgRegisterDataProxy{} } +func (m *MsgRegisterDataProxy) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterDataProxy) ProtoMessage() {} +func (*MsgRegisterDataProxy) Descriptor() ([]byte, []int) { + return fileDescriptor_729a83c1d20f3b97, []int{0} +} +func (m *MsgRegisterDataProxy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterDataProxy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterDataProxy.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 *MsgRegisterDataProxy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterDataProxy.Merge(m, src) +} +func (m *MsgRegisterDataProxy) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterDataProxy) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterDataProxy.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterDataProxy proto.InternalMessageInfo + +func (m *MsgRegisterDataProxy) GetPayoutAddress() string { + if m != nil { + return m.PayoutAddress + } + return "" +} + +func (m *MsgRegisterDataProxy) GetFee() *types.Coin { + if m != nil { + return m.Fee + } + return nil +} + +func (m *MsgRegisterDataProxy) GetMemo() string { + if m != nil { + return m.Memo + } + return "" +} + +func (m *MsgRegisterDataProxy) GetPubKey() *types1.Any { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *MsgRegisterDataProxy) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// No response required. +type MsgRegisterDataProxyResponse struct { +} + +func (m *MsgRegisterDataProxyResponse) Reset() { *m = MsgRegisterDataProxyResponse{} } +func (m *MsgRegisterDataProxyResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterDataProxyResponse) ProtoMessage() {} +func (*MsgRegisterDataProxyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_729a83c1d20f3b97, []int{1} +} +func (m *MsgRegisterDataProxyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterDataProxyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterDataProxyResponse.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 *MsgRegisterDataProxyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterDataProxyResponse.Merge(m, src) +} +func (m *MsgRegisterDataProxyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterDataProxyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterDataProxyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterDataProxyResponse proto.InternalMessageInfo + +// Allow updating memo and payout address instantly and/or scheduling a fee +// update. +type MsgEditDataProxy struct { + NewPayoutAddress string `protobuf:"bytes,1,opt,name=new_payout_address,json=newPayoutAddress,proto3" json:"new_payout_address,omitempty"` + NewMemo string `protobuf:"bytes,2,opt,name=new_memo,json=newMemo,proto3" json:"new_memo,omitempty"` + NewFee *types.Coin `protobuf:"bytes,3,opt,name=new_fee,json=newFee,proto3" json:"new_fee,omitempty"` + FeeUpdateDelay uint32 `protobuf:"varint,4,opt,name=fee_update_delay,json=feeUpdateDelay,proto3" json:"fee_update_delay,omitempty"` + PubKey *types1.Any `protobuf:"bytes,5,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + Signature []byte `protobuf:"bytes,6,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgEditDataProxy) Reset() { *m = MsgEditDataProxy{} } +func (m *MsgEditDataProxy) String() string { return proto.CompactTextString(m) } +func (*MsgEditDataProxy) ProtoMessage() {} +func (*MsgEditDataProxy) Descriptor() ([]byte, []int) { + return fileDescriptor_729a83c1d20f3b97, []int{2} +} +func (m *MsgEditDataProxy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditDataProxy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditDataProxy.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 *MsgEditDataProxy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditDataProxy.Merge(m, src) +} +func (m *MsgEditDataProxy) XXX_Size() int { + return m.Size() +} +func (m *MsgEditDataProxy) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditDataProxy.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditDataProxy proto.InternalMessageInfo + +func (m *MsgEditDataProxy) GetNewPayoutAddress() string { + if m != nil { + return m.NewPayoutAddress + } + return "" +} + +func (m *MsgEditDataProxy) GetNewMemo() string { + if m != nil { + return m.NewMemo + } + return "" +} + +func (m *MsgEditDataProxy) GetNewFee() *types.Coin { + if m != nil { + return m.NewFee + } + return nil +} + +func (m *MsgEditDataProxy) GetFeeUpdateDelay() uint32 { + if m != nil { + return m.FeeUpdateDelay + } + return 0 +} + +func (m *MsgEditDataProxy) GetPubKey() *types1.Any { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *MsgEditDataProxy) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// Returns the height at which the fee update will go into effect. +type MsgEditDataProxyResponse struct { + UpdateHeight int64 `protobuf:"varint,1,opt,name=update_height,json=updateHeight,proto3" json:"update_height,omitempty"` +} + +func (m *MsgEditDataProxyResponse) Reset() { *m = MsgEditDataProxyResponse{} } +func (m *MsgEditDataProxyResponse) String() string { return proto.CompactTextString(m) } +func (*MsgEditDataProxyResponse) ProtoMessage() {} +func (*MsgEditDataProxyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_729a83c1d20f3b97, []int{3} +} +func (m *MsgEditDataProxyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgEditDataProxyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgEditDataProxyResponse.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 *MsgEditDataProxyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgEditDataProxyResponse.Merge(m, src) +} +func (m *MsgEditDataProxyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgEditDataProxyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgEditDataProxyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgEditDataProxyResponse proto.InternalMessageInfo + +func (m *MsgEditDataProxyResponse) GetUpdateHeight() int64 { + if m != nil { + return m.UpdateHeight + } + return 0 +} + +// The request message for the UpdateParams method. +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless + // overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_729a83c1d20f3b97, []int{4} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// No response required. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_729a83c1d20f3b97, []int{5} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgRegisterDataProxy)(nil), "sedachain.data_proxy_registry.v1.MsgRegisterDataProxy") + proto.RegisterType((*MsgRegisterDataProxyResponse)(nil), "sedachain.data_proxy_registry.v1.MsgRegisterDataProxyResponse") + proto.RegisterType((*MsgEditDataProxy)(nil), "sedachain.data_proxy_registry.v1.MsgEditDataProxy") + proto.RegisterType((*MsgEditDataProxyResponse)(nil), "sedachain.data_proxy_registry.v1.MsgEditDataProxyResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "sedachain.data_proxy_registry.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "sedachain.data_proxy_registry.v1.MsgUpdateParamsResponse") +} + +func init() { + proto.RegisterFile("sedachain/data_proxy_registry/v1/tx.proto", fileDescriptor_729a83c1d20f3b97) +} + +var fileDescriptor_729a83c1d20f3b97 = []byte{ + // 689 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0xb3, 0x4d, 0x9b, 0xda, 0xb1, 0xa9, 0x75, 0x09, 0x74, 0x1b, 0xca, 0x36, 0xc4, 0x4b, + 0x54, 0x32, 0x4b, 0x2a, 0x14, 0xed, 0xa1, 0xa5, 0xb5, 0x56, 0x41, 0x02, 0x61, 0x45, 0x10, 0x2f, + 0xcb, 0x6c, 0xf6, 0x65, 0xb2, 0xd8, 0xdd, 0x59, 0x76, 0x66, 0x9b, 0x2e, 0x08, 0x82, 0x57, 0x2f, + 0xe2, 0x37, 0xf0, 0x1b, 0x78, 0xf0, 0x43, 0x14, 0xf1, 0x50, 0x3c, 0x79, 0x12, 0x69, 0x0f, 0x7e, + 0x0c, 0x65, 0x67, 0x37, 0x49, 0x53, 0x03, 0x69, 0xc4, 0xd3, 0xce, 0xcc, 0x7b, 0xff, 0x37, 0xff, + 0xf7, 0xdb, 0x99, 0x41, 0xb7, 0x39, 0x38, 0xa4, 0xdd, 0x25, 0xae, 0x6f, 0x38, 0x44, 0x10, 0x2b, + 0x08, 0xd9, 0x71, 0x6c, 0x85, 0x40, 0x5d, 0x2e, 0xc2, 0xd8, 0x38, 0x6a, 0x18, 0xe2, 0x18, 0x07, + 0x21, 0x13, 0x4c, 0xad, 0x0c, 0x52, 0xf1, 0x98, 0x54, 0x7c, 0xd4, 0x28, 0x97, 0x28, 0xa3, 0x4c, + 0x26, 0x1b, 0xc9, 0x28, 0xd5, 0x95, 0x57, 0x29, 0x63, 0xf4, 0x10, 0x0c, 0x39, 0xb3, 0xa3, 0x8e, + 0x41, 0xfc, 0xb8, 0x1f, 0x6a, 0x33, 0xee, 0x31, 0x6e, 0xa5, 0x9a, 0x74, 0x92, 0x85, 0xf4, 0x74, + 0x66, 0xd8, 0x84, 0x83, 0x71, 0xd4, 0xb0, 0x41, 0x90, 0x86, 0xd1, 0x66, 0xae, 0x9f, 0xc5, 0x57, + 0xb2, 0xb8, 0xc7, 0x69, 0xe2, 0xd2, 0xe3, 0x34, 0x0b, 0x6c, 0x4d, 0xec, 0x68, 0x9c, 0x7b, 0xa9, + 0xad, 0xfe, 0x56, 0x50, 0xa9, 0xc9, 0xa9, 0x29, 0x57, 0x21, 0xdc, 0x27, 0x82, 0xb4, 0x92, 0x3c, + 0x75, 0x07, 0x2d, 0x05, 0x24, 0x66, 0x91, 0xb0, 0x88, 0xe3, 0x84, 0xc0, 0xb9, 0xa6, 0x54, 0x94, + 0xda, 0xc2, 0x9e, 0xf6, 0xed, 0x73, 0xbd, 0x94, 0xf9, 0xde, 0x4d, 0x23, 0xcf, 0x44, 0xe8, 0xfa, + 0xd4, 0x2c, 0xa6, 0xf9, 0xd9, 0xa2, 0x7a, 0x17, 0xe5, 0x3b, 0x00, 0xda, 0x4c, 0x45, 0xa9, 0x5d, + 0xdf, 0x58, 0xc5, 0x99, 0x24, 0x69, 0x0e, 0x67, 0xcd, 0xe1, 0x87, 0xcc, 0xf5, 0xcd, 0x24, 0x4b, + 0x55, 0xd1, 0xac, 0x07, 0x1e, 0xd3, 0xf2, 0xc9, 0x1e, 0xa6, 0x1c, 0xab, 0x8f, 0xd1, 0x7c, 0x10, + 0xd9, 0xd6, 0x2b, 0x88, 0xb5, 0x59, 0x59, 0xa4, 0x84, 0x53, 0xae, 0xb8, 0xcf, 0x15, 0xef, 0xfa, + 0xf1, 0x9e, 0xf6, 0x65, 0x68, 0xa8, 0x1d, 0xc6, 0x81, 0x60, 0xb8, 0x15, 0xd9, 0x4f, 0x21, 0x36, + 0x0b, 0x81, 0xfc, 0xaa, 0x6b, 0x68, 0x81, 0xbb, 0xd4, 0x27, 0x22, 0x0a, 0x41, 0x9b, 0xab, 0x28, + 0xb5, 0x45, 0x73, 0xb8, 0x50, 0xd5, 0xd1, 0xda, 0x38, 0x00, 0x26, 0xf0, 0x80, 0xf9, 0x1c, 0xaa, + 0x5f, 0x67, 0xd0, 0x72, 0x93, 0xd3, 0x47, 0x8e, 0x2b, 0x86, 0x74, 0x0e, 0x90, 0xea, 0x43, 0xcf, + 0x9a, 0x92, 0xd0, 0xb2, 0x0f, 0xbd, 0xd6, 0x08, 0xa4, 0x75, 0x74, 0x2d, 0xa9, 0x23, 0x7b, 0x9f, + 0x91, 0xea, 0xd9, 0x93, 0x1f, 0xeb, 0x8a, 0x39, 0xef, 0x43, 0xaf, 0x99, 0x40, 0xb8, 0x8f, 0x92, + 0xa1, 0x95, 0x90, 0xcc, 0x4f, 0x20, 0x99, 0x49, 0x0b, 0x3e, 0xf4, 0x0e, 0x00, 0x54, 0x8c, 0x96, + 0x3b, 0x00, 0x56, 0x14, 0x38, 0x44, 0x80, 0xe5, 0xc0, 0x21, 0x49, 0x39, 0x16, 0xb3, 0xbc, 0xa5, + 0x0e, 0xc0, 0x73, 0x19, 0xdc, 0x4f, 0x62, 0x17, 0x71, 0xcf, 0xfd, 0x3f, 0xdc, 0x85, 0xcb, 0xb8, + 0x77, 0x90, 0x76, 0x99, 0x66, 0x1f, 0xb5, 0x7a, 0x0b, 0x15, 0x33, 0xbb, 0x5d, 0x70, 0x69, 0x57, + 0x48, 0xa0, 0x79, 0x73, 0x31, 0x5d, 0x7c, 0x22, 0xd7, 0xaa, 0x1f, 0x15, 0x74, 0xa3, 0xc9, 0x69, + 0x6a, 0xbd, 0x45, 0x42, 0xe2, 0x71, 0x75, 0x13, 0x2d, 0x90, 0x48, 0x74, 0x59, 0xe8, 0x8a, 0x78, + 0xe2, 0x5f, 0x18, 0xa6, 0xaa, 0x07, 0xa8, 0x10, 0xc8, 0x0a, 0xd9, 0x31, 0xad, 0xe1, 0x49, 0x37, + 0x1e, 0xa7, 0x3b, 0x4a, 0x86, 0x39, 0x33, 0x53, 0x6f, 0x2d, 0xbd, 0xfd, 0xf5, 0xe9, 0xce, 0xb0, + 0x6e, 0x75, 0x15, 0xad, 0x5c, 0xb2, 0xd8, 0xef, 0x71, 0xe3, 0x43, 0x1e, 0xe5, 0x9b, 0x9c, 0xaa, + 0xef, 0x14, 0x74, 0xf3, 0xef, 0x5b, 0xb7, 0x39, 0xd9, 0xc0, 0xb8, 0xc3, 0x5a, 0xde, 0xfe, 0x37, + 0xdd, 0x80, 0xfc, 0x1b, 0x54, 0x1c, 0x3d, 0xe0, 0x1b, 0x57, 0x2a, 0x38, 0xa2, 0x29, 0x6f, 0x4d, + 0xaf, 0x19, 0x18, 0x78, 0x8d, 0x16, 0x47, 0xfe, 0x68, 0xe3, 0x4a, 0xb5, 0x2e, 0x4a, 0xca, 0x0f, + 0xa6, 0x96, 0xf4, 0x77, 0xdf, 0x7b, 0x71, 0x72, 0xa6, 0x2b, 0xa7, 0x67, 0xba, 0xf2, 0xf3, 0x4c, + 0x57, 0xde, 0x9f, 0xeb, 0xb9, 0xd3, 0x73, 0x3d, 0xf7, 0xfd, 0x5c, 0xcf, 0xbd, 0xdc, 0xa6, 0xae, + 0xe8, 0x46, 0x36, 0x6e, 0x33, 0xcf, 0x48, 0xca, 0xcb, 0xbb, 0xd0, 0x66, 0x87, 0x72, 0x52, 0x4f, + 0x1f, 0xdd, 0x63, 0xf9, 0xbe, 0xd6, 0xe5, 0x76, 0xf5, 0xc1, 0xb3, 0x2b, 0xe2, 0x00, 0xb8, 0x5d, + 0x90, 0x82, 0x7b, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa4, 0x2b, 0xde, 0xfa, 0x76, 0x06, 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 { + // Registers a new data proxy entry in the registry. + RegisterDataProxy(ctx context.Context, in *MsgRegisterDataProxy, opts ...grpc.CallOption) (*MsgRegisterDataProxyResponse, error) + // Edits an existing data proxy. + EditDataProxy(ctx context.Context, in *MsgEditDataProxy, opts ...grpc.CallOption) (*MsgEditDataProxyResponse, error) + // Used to update the modules parameters through governance. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) RegisterDataProxy(ctx context.Context, in *MsgRegisterDataProxy, opts ...grpc.CallOption) (*MsgRegisterDataProxyResponse, error) { + out := new(MsgRegisterDataProxyResponse) + err := c.cc.Invoke(ctx, "/sedachain.data_proxy_registry.v1.Msg/RegisterDataProxy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) EditDataProxy(ctx context.Context, in *MsgEditDataProxy, opts ...grpc.CallOption) (*MsgEditDataProxyResponse, error) { + out := new(MsgEditDataProxyResponse) + err := c.cc.Invoke(ctx, "/sedachain.data_proxy_registry.v1.Msg/EditDataProxy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/sedachain.data_proxy_registry.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Registers a new data proxy entry in the registry. + RegisterDataProxy(context.Context, *MsgRegisterDataProxy) (*MsgRegisterDataProxyResponse, error) + // Edits an existing data proxy. + EditDataProxy(context.Context, *MsgEditDataProxy) (*MsgEditDataProxyResponse, error) + // Used to update the modules parameters through governance. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) RegisterDataProxy(ctx context.Context, req *MsgRegisterDataProxy) (*MsgRegisterDataProxyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterDataProxy not implemented") +} +func (*UnimplementedMsgServer) EditDataProxy(ctx context.Context, req *MsgEditDataProxy) (*MsgEditDataProxyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EditDataProxy not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_RegisterDataProxy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterDataProxy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterDataProxy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sedachain.data_proxy_registry.v1.Msg/RegisterDataProxy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterDataProxy(ctx, req.(*MsgRegisterDataProxy)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_EditDataProxy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgEditDataProxy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).EditDataProxy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sedachain.data_proxy_registry.v1.Msg/EditDataProxy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).EditDataProxy(ctx, req.(*MsgEditDataProxy)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/sedachain.data_proxy_registry.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "sedachain.data_proxy_registry.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RegisterDataProxy", + Handler: _Msg_RegisterDataProxy_Handler, + }, + { + MethodName: "EditDataProxy", + Handler: _Msg_EditDataProxy_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "sedachain/data_proxy_registry/v1/tx.proto", +} + +func (m *MsgRegisterDataProxy) 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 *MsgRegisterDataProxy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterDataProxy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x2a + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Memo) > 0 { + i -= len(m.Memo) + copy(dAtA[i:], m.Memo) + i = encodeVarintTx(dAtA, i, uint64(len(m.Memo))) + i-- + dAtA[i] = 0x1a + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.PayoutAddress) > 0 { + i -= len(m.PayoutAddress) + copy(dAtA[i:], m.PayoutAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.PayoutAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterDataProxyResponse) 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 *MsgRegisterDataProxyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterDataProxyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgEditDataProxy) 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 *MsgEditDataProxy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditDataProxy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x32 + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.FeeUpdateDelay != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.FeeUpdateDelay)) + i-- + dAtA[i] = 0x20 + } + if m.NewFee != nil { + { + size, err := m.NewFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.NewMemo) > 0 { + i -= len(m.NewMemo) + copy(dAtA[i:], m.NewMemo) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewMemo))) + i-- + dAtA[i] = 0x12 + } + if len(m.NewPayoutAddress) > 0 { + i -= len(m.NewPayoutAddress) + copy(dAtA[i:], m.NewPayoutAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewPayoutAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgEditDataProxyResponse) 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 *MsgEditDataProxyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgEditDataProxyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UpdateHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.UpdateHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) 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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgRegisterDataProxy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PayoutAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Memo) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterDataProxyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgEditDataProxy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NewPayoutAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NewMemo) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.NewFee != nil { + l = m.NewFee.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.FeeUpdateDelay != 0 { + n += 1 + sovTx(uint64(m.FeeUpdateDelay)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgEditDataProxyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UpdateHeight != 0 { + n += 1 + sovTx(uint64(m.UpdateHeight)) + } + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) 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 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgRegisterDataProxy) 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: MsgRegisterDataProxy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterDataProxy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PayoutAddress", 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.PayoutAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Fee == nil { + m.Fee = &types.Coin{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Memo", 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.Memo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", 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.PubKey == nil { + m.PubKey = &types1.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", 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.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + 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 *MsgRegisterDataProxyResponse) 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: MsgRegisterDataProxyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterDataProxyResponse: 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgEditDataProxy) 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: MsgEditDataProxy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditDataProxy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPayoutAddress", 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.NewPayoutAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewMemo", 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.NewMemo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewFee", 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.NewFee == nil { + m.NewFee = &types.Coin{} + } + if err := m.NewFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeUpdateDelay", wireType) + } + m.FeeUpdateDelay = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FeeUpdateDelay |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", 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.PubKey == nil { + m.PubKey = &types1.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", 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.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + 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 *MsgEditDataProxyResponse) 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: MsgEditDataProxyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgEditDataProxyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UpdateHeight", wireType) + } + m.UpdateHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UpdateHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params.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 *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: 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) || (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") +)