From cb246083dd72bfdb41dc0198dd7923b73e278fcd Mon Sep 17 00:00:00 2001 From: Oren Laadan Date: Mon, 27 Feb 2023 01:38:51 -0500 Subject: [PATCH] CNS-169: create module subscription command: ignite scaffold module subscription --- docs/static/openapi.yml | 46 ++ proto/subscription/genesis.proto | 14 + proto/subscription/params.proto | 12 + proto/subscription/query.proto | 30 + proto/subscription/tx.proto | 13 + .../cosmos/tx/config/v1/config.pulsar.go | 2 +- .../tx/signing/v1beta1/signing.pulsar.go | 2 +- .../cosmos/tx/v1beta1/service.pulsar.go | 4 +- .../cosmos/tx/v1beta1/tx.pulsar.go | 4 +- .../ibc/apps/29-fee/types/ack.pb.go | 2 +- .../ibc/apps/29-fee/types/fee.pb.go | 4 +- .../ibc/apps/29-fee/types/genesis.pb.go | 2 +- .../ibc/apps/29-fee/types/query.pb.go | 2 +- .../ibc/apps/29-fee/types/tx.pb.go | 4 +- .../controller/types/tx.pb.go | 2 +- .../genesis/types/genesis.pb.go | 4 +- .../ibc/apps/transfer/types/tx.pb.go | 2 +- .../core/23-commitment/types/commitment.pb.go | 4 +- .../ibc/core/channel/types/channel.pb.go | 2 +- .../ibc/core/channel/types/query.pb.go | 2 +- .../ibc/core/channel/types/tx.pb.go | 2 +- .../client/migrations/v7/solomachine.pb.go | 4 +- .../ibc/core/client/types/client.pb.go | 32 +- .../ibc/core/client/types/tx.pb.go | 2 +- .../core/connection/types/connection.pb.go | 2 +- .../ibc/core/connection/types/query.pb.go | 2 +- .../ibc/core/connection/types/tx.pb.go | 2 +- .../ibc/core/types/genesis.pb.go | 6 +- .../07-tendermint/tendermint.pb.go | 4 +- .../osmosis_protobufs/gamm/types/gov.pb.go | 8 +- .../osmosis_protobufs/mint/types/mint.pb.go | 4 +- .../pool-incentives/types/gov.pb.go | 8 +- .../pool-incentives/types/incentives.pb.go | 4 +- .../protorev/types/gov.pb.go | 8 +- .../superfluid/types/gov.pb.go | 12 +- .../osmosis_protobufs/txfees/types/gov.pb.go | 4 +- testutil/keeper/subscription.go | 52 ++ x/spec/keeper/spec_test.go | 8 +- x/subscription/client/cli/query.go | 31 + x/subscription/client/cli/query_params.go | 34 ++ x/subscription/client/cli/tx.go | 34 ++ x/subscription/genesis.go | 24 + x/subscription/genesis_test.go | 29 + x/subscription/handler.go | 26 + x/subscription/keeper/grpc_query.go | 7 + x/subscription/keeper/grpc_query_params.go | 19 + .../keeper/grpc_query_params_test.go | 21 + x/subscription/keeper/keeper.go | 44 ++ x/subscription/keeper/msg_server.go | 17 + x/subscription/keeper/msg_server_test.go | 16 + x/subscription/keeper/params.go | 16 + x/subscription/keeper/params_test.go | 18 + x/subscription/module.go | 176 ++++++ x/subscription/module_simulation.go | 63 ++ x/subscription/simulation/simap.go | 15 + x/subscription/types/codec.go | 24 + x/subscription/types/errors.go | 12 + x/subscription/types/expected_keepers.go | 18 + x/subscription/types/genesis.go | 22 + x/subscription/types/genesis.pb.go | 321 +++++++++++ x/subscription/types/genesis_test.go | 40 ++ x/subscription/types/keys.go | 22 + x/subscription/types/params.go | 39 ++ x/subscription/types/params.pb.go | 264 +++++++++ x/subscription/types/query.pb.go | 537 ++++++++++++++++++ x/subscription/types/query.pb.gw.go | 153 +++++ x/subscription/types/tx.pb.go | 80 +++ x/subscription/types/types.go | 1 + 68 files changed, 2367 insertions(+), 77 deletions(-) create mode 100644 proto/subscription/genesis.proto create mode 100644 proto/subscription/params.proto create mode 100644 proto/subscription/query.proto create mode 100644 proto/subscription/tx.proto create mode 100644 testutil/keeper/subscription.go create mode 100644 x/subscription/client/cli/query.go create mode 100644 x/subscription/client/cli/query_params.go create mode 100644 x/subscription/client/cli/tx.go create mode 100644 x/subscription/genesis.go create mode 100644 x/subscription/genesis_test.go create mode 100644 x/subscription/handler.go create mode 100644 x/subscription/keeper/grpc_query.go create mode 100644 x/subscription/keeper/grpc_query_params.go create mode 100644 x/subscription/keeper/grpc_query_params_test.go create mode 100644 x/subscription/keeper/keeper.go create mode 100644 x/subscription/keeper/msg_server.go create mode 100644 x/subscription/keeper/msg_server_test.go create mode 100644 x/subscription/keeper/params.go create mode 100644 x/subscription/keeper/params_test.go create mode 100644 x/subscription/module.go create mode 100644 x/subscription/module_simulation.go create mode 100644 x/subscription/simulation/simap.go create mode 100644 x/subscription/types/codec.go create mode 100644 x/subscription/types/errors.go create mode 100644 x/subscription/types/expected_keepers.go create mode 100644 x/subscription/types/genesis.go create mode 100644 x/subscription/types/genesis.pb.go create mode 100644 x/subscription/types/genesis_test.go create mode 100644 x/subscription/types/keys.go create mode 100644 x/subscription/types/params.go create mode 100644 x/subscription/types/params.pb.go create mode 100644 x/subscription/types/query.pb.go create mode 100644 x/subscription/types/query.pb.gw.go create mode 100644 x/subscription/types/tx.pb.go create mode 100644 x/subscription/types/types.go diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 8a81a1d75f..720c1289e6 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -32599,6 +32599,42 @@ paths: type: string tags: - Query + /lavanet/lava/subscription/params: + get: + summary: Parameters queries the parameters of the module. + operationId: LavanetLavaSubscriptionParams + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query definitions: cosmos.auth.v1beta1.Params: type: object @@ -56100,3 +56136,13 @@ definitions: type: array items: type: string + lavanet.lava.subscription.Params: + type: object + description: Params defines the parameters for the module. + lavanet.lava.subscription.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + description: QueryParamsResponse is response type for the Query/Params RPC method. diff --git a/proto/subscription/genesis.proto b/proto/subscription/genesis.proto new file mode 100644 index 0000000000..82918a3913 --- /dev/null +++ b/proto/subscription/genesis.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; +package lavanet.lava.subscription; + +import "gogoproto/gogo.proto"; +import "subscription/params.proto"; +// this line is used by starport scaffolding # genesis/proto/import + +option go_package = "github.com/lavanet/lava/x/subscription/types"; + +// GenesisState defines the subscription module's genesis state. +message GenesisState { + Params params = 1 [(gogoproto.nullable) = false]; + // this line is used by starport scaffolding # genesis/proto/state +} diff --git a/proto/subscription/params.proto b/proto/subscription/params.proto new file mode 100644 index 0000000000..b21a6ba2b5 --- /dev/null +++ b/proto/subscription/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package lavanet.lava.subscription; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/lavanet/lava/x/subscription/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + +} diff --git a/proto/subscription/query.proto b/proto/subscription/query.proto new file mode 100644 index 0000000000..9d27381333 --- /dev/null +++ b/proto/subscription/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package lavanet.lava.subscription; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "subscription/params.proto"; +// this line is used by starport scaffolding # 1 + +option go_package = "github.com/lavanet/lava/x/subscription/types"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/lavanet/lava/subscription/params"; + } + // this line is used by starport scaffolding # 2 +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// this line is used by starport scaffolding # 3 diff --git a/proto/subscription/tx.proto b/proto/subscription/tx.proto new file mode 100644 index 0000000000..6ae35967ea --- /dev/null +++ b/proto/subscription/tx.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package lavanet.lava.subscription; + +// this line is used by starport scaffolding # proto/tx/import + +option go_package = "github.com/lavanet/lava/x/subscription/types"; + +// Msg defines the Msg service. +service Msg { + // this line is used by starport scaffolding # proto/tx/rpc +} + +// this line is used by starport scaffolding # proto/tx/message diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/config/v1/config.pulsar.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/config/v1/config.pulsar.go index 7803bb3f23..80f2a90ab4 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/config/v1/config.pulsar.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/config/v1/config.pulsar.go @@ -595,7 +595,7 @@ var file_cosmos_tx_config_v1_config_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { }//file_cosmos_tx_config_v1_config_proto_init() } +func init() {} //file_cosmos_tx_config_v1_config_proto_init() } func file_cosmos_tx_config_v1_config_proto_init() { if File_cosmos_tx_config_v1_config_proto != nil { return diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/signing/v1beta1/signing.pulsar.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/signing/v1beta1/signing.pulsar.go index 1d77632d70..8b3559dc84 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/signing/v1beta1/signing.pulsar.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/signing/v1beta1/signing.pulsar.go @@ -3183,7 +3183,7 @@ var file_cosmos_tx_signing_v1beta1_signing_proto_depIdxs = []int32{ 0, // [0:8] is the sub-list for field type_name } -func init() { }//file_cosmos_tx_signing_v1beta1_signing_proto_init() } +func init() {} //file_cosmos_tx_signing_v1beta1_signing_proto_init() } func file_cosmos_tx_signing_v1beta1_signing_proto_init() { if File_cosmos_tx_signing_v1beta1_signing_proto != nil { return diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/service.pulsar.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/service.pulsar.go index 0922e549e7..05b91a94f6 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/service.pulsar.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/service.pulsar.go @@ -10242,8 +10242,8 @@ var file_cosmos_tx_v1beta1_service_proto_depIdxs = []int32{ 0, // [0:19] is the sub-list for field type_name } -func init() { - // file_cosmos_tx_v1beta1_service_proto_init() +func init() { + // file_cosmos_tx_v1beta1_service_proto_init() } func file_cosmos_tx_v1beta1_service_proto_init() { if File_cosmos_tx_v1beta1_service_proto != nil { diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/tx.pulsar.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/tx.pulsar.go index e86f3c60bf..ae2db593d8 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/tx.pulsar.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/cosmos/tx/v1beta1/tx.pulsar.go @@ -9197,8 +9197,8 @@ var file_cosmos_tx_v1beta1_tx_proto_depIdxs = []int32{ 0, // [0:21] is the sub-list for field type_name } -func init() { - file_cosmos_tx_v1beta1_tx_proto_init() +func init() { + file_cosmos_tx_v1beta1_tx_proto_init() } func file_cosmos_tx_v1beta1_tx_proto_init() { if File_cosmos_tx_v1beta1_tx_proto != nil { diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/ack.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/ack.pb.go index 842717253e..4154fcb409 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/ack.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/ack.pb.go @@ -91,7 +91,7 @@ func init() { //proto.RegisterType((*IncentivizedAcknowledgement)(nil), "ibc.applications.fee.v1.IncentivizedAcknowledgement") } -func init() { }//proto.RegisterFile("ibc/applications/fee/v1/ack.proto", fileDescriptor_ab2834946fb65ea4) } +func init() {} //proto.RegisterFile("ibc/applications/fee/v1/ack.proto", fileDescriptor_ab2834946fb65ea4) } var fileDescriptor_ab2834946fb65ea4 = []byte{ // 330 bytes of a gzipped FileDescriptorProto diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/fee.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/fee.pb.go index 8cd066af26..23e64ac9e0 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/fee.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/fee.pb.go @@ -7,9 +7,9 @@ import ( fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" io "io" math "math" math_bits "math/bits" @@ -262,7 +262,7 @@ func init() { //proto.RegisterType((*IdentifiedPacketFees)(nil), "ibc.applications.fee.v1.IdentifiedPacketFees") } -func init() { }//proto.RegisterFile("ibc/applications/fee/v1/fee.proto", fileDescriptor_cb3319f1af2a53e5) } +func init() {} //proto.RegisterFile("ibc/applications/fee/v1/fee.proto", fileDescriptor_cb3319f1af2a53e5) } var fileDescriptor_cb3319f1af2a53e5 = []byte{ // 526 bytes of a gzipped FileDescriptorProto diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/genesis.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/genesis.pb.go index 30d8216512..9345aa8738 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/genesis.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/genesis.pb.go @@ -5,9 +5,9 @@ package types import ( fmt "fmt" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" io "io" math "math" math_bits "math/bits" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/query.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/query.pb.go index af87a63950..be078419de 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/query.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/query.pb.go @@ -9,10 +9,10 @@ import ( github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types1 "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/tx.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/tx.pb.go index 7df022921f..c8948e73da 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/tx.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/29-fee/types/tx.pb.go @@ -6,10 +6,10 @@ package types import ( context "context" fmt "fmt" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -369,7 +369,7 @@ func init() { //proto.RegisterType((*MsgPayPacketFeeAsyncResponse)(nil), "ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse") } -func init() { }//proto.RegisterFile("ibc/applications/fee/v1/tx.proto", fileDescriptor_05c93128649f1b96) } +func init() {} //proto.RegisterFile("ibc/applications/fee/v1/tx.proto", fileDescriptor_05c93128649f1b96) } var fileDescriptor_05c93128649f1b96 = []byte{ // 699 bytes of a gzipped FileDescriptorProto diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/controller/types/tx.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/controller/types/tx.pb.go index b25ddbd876..128eb3d26f 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/controller/types/tx.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/controller/types/tx.pb.go @@ -6,10 +6,10 @@ package types import ( context "context" fmt "fmt" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/genesis/types/genesis.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/genesis/types/genesis.pb.go index 91accc112d..8ae5398e4d 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/genesis/types/genesis.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/genesis/types/genesis.pb.go @@ -5,10 +5,10 @@ package types import ( fmt "fmt" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/host/types" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/controller/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/controller/types" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/interchain-accounts/host/types" io "io" math "math" math_bits "math/bits" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/transfer/types/tx.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/transfer/types/tx.pb.go index a34d525f5a..a820612076 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/transfer/types/tx.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/apps/transfer/types/tx.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types/commitment.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types/commitment.pb.go index ae7e7c5c93..42d19b509e 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types/commitment.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types/commitment.pb.go @@ -117,9 +117,9 @@ type MerklePath struct { KeyPath []string `protobuf:"bytes,1,rep,name=key_path,json=keyPath,proto3" json:"key_path,omitempty" yaml:"key_path"` } -func (m *MerklePath) Reset() { *m = MerklePath{} } +func (m *MerklePath) Reset() { *m = MerklePath{} } func (m *MerklePath) String() string { return proto.CompactTextString(m) } -func (*MerklePath) ProtoMessage() {} +func (*MerklePath) ProtoMessage() {} func (*MerklePath) Descriptor() ([]byte, []int) { return fileDescriptor_7921d88972a41469, []int{2} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/channel.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/channel.pb.go index eb6394bc1e..f27ff8acca 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/channel.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/channel.pb.go @@ -5,9 +5,9 @@ package types import ( fmt "fmt" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" io "io" math "math" math_bits "math/bits" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/query.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/query.pb.go index 8402cb7fa7..e033d7a95c 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/query.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/query.pb.go @@ -8,10 +8,10 @@ import ( fmt "fmt" types1 "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/tx.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/tx.pb.go index 4f51895205..0b006cc927 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/tx.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types/tx.pb.go @@ -6,10 +6,10 @@ package types import ( context "context" fmt "fmt" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/migrations/v7/solomachine.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/migrations/v7/solomachine.pb.go index ecf5d91294..e83735d17a 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/migrations/v7/solomachine.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/migrations/v7/solomachine.pb.go @@ -6,10 +6,10 @@ package v7 import ( fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" - types2 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types2 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types" io "io" math "math" math_bits "math/bits" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/client.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/client.pb.go index cf1ae259e8..1d85c6eaf0 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/client.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/client.pb.go @@ -258,9 +258,9 @@ type UpgradeProposal struct { UpgradedClientState *types.Any `protobuf:"bytes,4,opt,name=upgraded_client_state,json=upgradedClientState,proto3" json:"upgraded_client_state,omitempty" yaml:"upgraded_client_state"` } -func (m *UpgradeProposal) Reset() { *m = UpgradeProposal{} } +func (m *UpgradeProposal) Reset() { *m = UpgradeProposal{} } func (m *UpgradeProposal) String() string { return proto.CompactTextString(m) } -func (*UpgradeProposal) ProtoMessage() {} +func (*UpgradeProposal) ProtoMessage() {} func (*UpgradeProposal) Descriptor() ([]byte, []int) { return fileDescriptor_b6bc4c8185546947, []int{4} } @@ -271,12 +271,12 @@ func (m *UpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, err // if deterministic { // return xxx_messageInfo_UpgradeProposal.Marshal(b, m, deterministic) // } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil // } } func (m *UpgradeProposal) XXX_Merge(src proto.Message) { @@ -308,9 +308,9 @@ type Height struct { RevisionHeight uint64 `protobuf:"varint,2,opt,name=revision_height,json=revisionHeight,proto3" json:"revision_height,omitempty" yaml:"revision_height"` } -func (m *Height) Reset() { *m = Height{} } +func (m *Height) Reset() { *m = Height{} } func (m *Height) String() string { return proto.CompactTextString(m) } -func (*Height) ProtoMessage() {} +func (*Height) ProtoMessage() {} func (*Height) Descriptor() ([]byte, []int) { return fileDescriptor_b6bc4c8185546947, []int{5} } @@ -321,12 +321,12 @@ func (m *Height) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { // if deterministic { // return xxx_messageInfo_Height.Marshal(b, m, deterministic) // } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil // } } func (m *Height) XXX_Merge(src proto.Message) { diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/tx.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/tx.pb.go index eab9c53e6a..3b3d2ee2da 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/tx.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types/tx.pb.go @@ -374,7 +374,7 @@ func init() { //proto.RegisterType((*MsgSubmitMisbehaviourResponse)(nil), "ibc.core.client.v1.MsgSubmitMisbehaviourResponse") } -func init() { }//proto.RegisterFile("ibc/core/client/v1/tx.proto", fileDescriptor_cb5dc4651eb49a04) } +func init() {} //proto.RegisterFile("ibc/core/client/v1/tx.proto", fileDescriptor_cb5dc4651eb49a04) } var fileDescriptor_cb5dc4651eb49a04 = []byte{ // 623 bytes of a gzipped FileDescriptorProto diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/connection.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/connection.pb.go index 2df52efe9f..eb92c8d6b7 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/connection.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/connection.pb.go @@ -5,9 +5,9 @@ package types import ( fmt "fmt" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types" io "io" math "math" math_bits "math/bits" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/query.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/query.pb.go index 13c720e2d2..017d7a8884 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/query.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/query.pb.go @@ -8,10 +8,10 @@ import ( fmt "fmt" types1 "github.com/cosmos/cosmos-sdk/codec/types" query "github.com/cosmos/cosmos-sdk/types/query" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/tx.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/tx.pb.go index aec5242630..1f6c3fe4ce 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/tx.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types/tx.pb.go @@ -7,10 +7,10 @@ import ( context "context" fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/types/genesis.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/types/genesis.pb.go index 4f45c95261..26039b05f2 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/types/genesis.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/types/genesis.pb.go @@ -5,11 +5,11 @@ package types import ( fmt "fmt" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types" - types2 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + types2 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/channel/types" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/connection/types" io "io" math "math" math_bits "math/bits" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/light-clients/07-tendermint/tendermint.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/light-clients/07-tendermint/tendermint.pb.go index 0c210fd87c..0a7e46945a 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/light-clients/07-tendermint/tendermint.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/light-clients/07-tendermint/tendermint.pb.go @@ -6,11 +6,11 @@ package tendermint import ( fmt "fmt" _go "github.com/confio/ics23/go" - types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" - types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types1 "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/23-commitment/types" + types "github.com/lavanet/lava/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/ibc/core/client/types" github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes" types2 "github.com/tendermint/tendermint/proto/tendermint/types" _ "google.golang.org/protobuf/types/known/durationpb" diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/gamm/types/gov.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/gamm/types/gov.pb.go index b9e6aef0eb..be26736663 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/gamm/types/gov.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/gamm/types/gov.pb.go @@ -34,9 +34,9 @@ type ReplaceMigrationRecordsProposal struct { Records []BalancerToConcentratedPoolLink `protobuf:"bytes,3,rep,name=records,proto3" json:"records"` } -func (m *ReplaceMigrationRecordsProposal) Reset() { *m = ReplaceMigrationRecordsProposal{} } +func (m *ReplaceMigrationRecordsProposal) Reset() { *m = ReplaceMigrationRecordsProposal{} } func (m *ReplaceMigrationRecordsProposal) String() string { return proto.CompactTextString(m) } -func (*ReplaceMigrationRecordsProposal) ProtoMessage() {} +func (*ReplaceMigrationRecordsProposal) ProtoMessage() {} func (*ReplaceMigrationRecordsProposal) Descriptor() ([]byte, []int) { return fileDescriptor_f31b9a6c0dbbdfa3, []int{0} } @@ -81,9 +81,9 @@ type UpdateMigrationRecordsProposal struct { Records []BalancerToConcentratedPoolLink `protobuf:"bytes,3,rep,name=records,proto3" json:"records"` } -func (m *UpdateMigrationRecordsProposal) Reset() { *m = UpdateMigrationRecordsProposal{} } +func (m *UpdateMigrationRecordsProposal) Reset() { *m = UpdateMigrationRecordsProposal{} } func (m *UpdateMigrationRecordsProposal) String() string { return proto.CompactTextString(m) } -func (*UpdateMigrationRecordsProposal) ProtoMessage() {} +func (*UpdateMigrationRecordsProposal) ProtoMessage() {} func (*UpdateMigrationRecordsProposal) Descriptor() ([]byte, []int) { return fileDescriptor_f31b9a6c0dbbdfa3, []int{1} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/mint/types/mint.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/mint/types/mint.pb.go index ef57136063..e4e7ac710a 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/mint/types/mint.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/mint/types/mint.pb.go @@ -192,9 +192,9 @@ type Params struct { MintingRewardsDistributionStartEpoch int64 `protobuf:"varint,8,opt,name=minting_rewards_distribution_start_epoch,json=mintingRewardsDistributionStartEpoch,proto3" json:"minting_rewards_distribution_start_epoch,omitempty" yaml:"minting_rewards_distribution_start_epoch"` } -func (m *Params) Reset() { *m = Params{} } +func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_ccb38f8335e0f45b, []int{3} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/gov.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/gov.pb.go index 49204ff1f3..5393210a15 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/gov.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/gov.pb.go @@ -36,9 +36,9 @@ type ReplacePoolIncentivesProposal struct { Records []DistrRecord `protobuf:"bytes,3,rep,name=records,proto3" json:"records"` } -func (m *ReplacePoolIncentivesProposal) Reset() { *m = ReplacePoolIncentivesProposal{} } +func (m *ReplacePoolIncentivesProposal) Reset() { *m = ReplacePoolIncentivesProposal{} } func (m *ReplacePoolIncentivesProposal) String() string { return proto.CompactTextString(m) } -func (*ReplacePoolIncentivesProposal) ProtoMessage() {} +func (*ReplacePoolIncentivesProposal) ProtoMessage() {} func (*ReplacePoolIncentivesProposal) Descriptor() ([]byte, []int) { return fileDescriptor_96caede426ba9516, []int{0} } @@ -82,9 +82,9 @@ type UpdatePoolIncentivesProposal struct { Records []DistrRecord `protobuf:"bytes,3,rep,name=records,proto3" json:"records"` } -func (m *UpdatePoolIncentivesProposal) Reset() { *m = UpdatePoolIncentivesProposal{} } +func (m *UpdatePoolIncentivesProposal) Reset() { *m = UpdatePoolIncentivesProposal{} } func (m *UpdatePoolIncentivesProposal) String() string { return proto.CompactTextString(m) } -func (*UpdatePoolIncentivesProposal) ProtoMessage() {} +func (*UpdatePoolIncentivesProposal) ProtoMessage() {} func (*UpdatePoolIncentivesProposal) Descriptor() ([]byte, []int) { return fileDescriptor_96caede426ba9516, []int{1} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/incentives.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/incentives.pb.go index 76409a42a0..1208472a03 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/incentives.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/pool-incentives/types/incentives.pb.go @@ -36,9 +36,9 @@ type Params struct { MintedDenom string `protobuf:"bytes,1,opt,name=minted_denom,json=mintedDenom,proto3" json:"minted_denom,omitempty" yaml:"minted_denom"` } -func (m *Params) Reset() { *m = Params{} } +func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} +func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_a8153bad03e553d1, []int{0} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/protorev/types/gov.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/protorev/types/gov.pb.go index 37339eddd5..95b93d9828 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/protorev/types/gov.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/protorev/types/gov.pb.go @@ -31,9 +31,9 @@ type SetProtoRevEnabledProposal struct { Enabled bool `protobuf:"varint,3,opt,name=enabled,proto3" json:"enabled,omitempty"` } -func (m *SetProtoRevEnabledProposal) Reset() { *m = SetProtoRevEnabledProposal{} } +func (m *SetProtoRevEnabledProposal) Reset() { *m = SetProtoRevEnabledProposal{} } func (m *SetProtoRevEnabledProposal) String() string { return proto.CompactTextString(m) } -func (*SetProtoRevEnabledProposal) ProtoMessage() {} +func (*SetProtoRevEnabledProposal) ProtoMessage() {} func (*SetProtoRevEnabledProposal) Descriptor() ([]byte, []int) { return fileDescriptor_e1f85ff7f3eaf8bb, []int{0} } @@ -73,9 +73,9 @@ type SetProtoRevAdminAccountProposal struct { Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"` } -func (m *SetProtoRevAdminAccountProposal) Reset() { *m = SetProtoRevAdminAccountProposal{} } +func (m *SetProtoRevAdminAccountProposal) Reset() { *m = SetProtoRevAdminAccountProposal{} } func (m *SetProtoRevAdminAccountProposal) String() string { return proto.CompactTextString(m) } -func (*SetProtoRevAdminAccountProposal) ProtoMessage() {} +func (*SetProtoRevAdminAccountProposal) ProtoMessage() {} func (*SetProtoRevAdminAccountProposal) Descriptor() ([]byte, []int) { return fileDescriptor_e1f85ff7f3eaf8bb, []int{1} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/superfluid/types/gov.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/superfluid/types/gov.pb.go index 97d400bd83..f60f2da007 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/superfluid/types/gov.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/superfluid/types/gov.pb.go @@ -31,9 +31,9 @@ type SetSuperfluidAssetsProposal struct { Assets []SuperfluidAsset `protobuf:"bytes,3,rep,name=assets,proto3" json:"assets"` } -func (m *SetSuperfluidAssetsProposal) Reset() { *m = SetSuperfluidAssetsProposal{} } +func (m *SetSuperfluidAssetsProposal) Reset() { *m = SetSuperfluidAssetsProposal{} } func (m *SetSuperfluidAssetsProposal) String() string { return proto.CompactTextString(m) } -func (*SetSuperfluidAssetsProposal) ProtoMessage() {} +func (*SetSuperfluidAssetsProposal) ProtoMessage() {} func (*SetSuperfluidAssetsProposal) Descriptor() ([]byte, []int) { return fileDescriptor_2e37d6a8d0e42294, []int{0} } @@ -72,9 +72,9 @@ type RemoveSuperfluidAssetsProposal struct { SuperfluidAssetDenoms []string `protobuf:"bytes,3,rep,name=superfluid_asset_denoms,json=superfluidAssetDenoms,proto3" json:"superfluid_asset_denoms,omitempty"` } -func (m *RemoveSuperfluidAssetsProposal) Reset() { *m = RemoveSuperfluidAssetsProposal{} } +func (m *RemoveSuperfluidAssetsProposal) Reset() { *m = RemoveSuperfluidAssetsProposal{} } func (m *RemoveSuperfluidAssetsProposal) String() string { return proto.CompactTextString(m) } -func (*RemoveSuperfluidAssetsProposal) ProtoMessage() {} +func (*RemoveSuperfluidAssetsProposal) ProtoMessage() {} func (*RemoveSuperfluidAssetsProposal) Descriptor() ([]byte, []int) { return fileDescriptor_2e37d6a8d0e42294, []int{1} } @@ -114,9 +114,9 @@ type UpdateUnpoolWhiteListProposal struct { IsOverwrite bool `protobuf:"varint,4,opt,name=is_overwrite,json=isOverwrite,proto3" json:"is_overwrite,omitempty"` } -func (m *UpdateUnpoolWhiteListProposal) Reset() { *m = UpdateUnpoolWhiteListProposal{} } +func (m *UpdateUnpoolWhiteListProposal) Reset() { *m = UpdateUnpoolWhiteListProposal{} } func (m *UpdateUnpoolWhiteListProposal) String() string { return proto.CompactTextString(m) } -func (*UpdateUnpoolWhiteListProposal) ProtoMessage() {} +func (*UpdateUnpoolWhiteListProposal) ProtoMessage() {} func (*UpdateUnpoolWhiteListProposal) Descriptor() ([]byte, []int) { return fileDescriptor_2e37d6a8d0e42294, []int{2} } diff --git a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/txfees/types/gov.pb.go b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/txfees/types/gov.pb.go index d7258a88ca..e4f3c49030 100644 --- a/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/txfees/types/gov.pb.go +++ b/protocol/chainlib/chainproxy/thirdparty/thirdparty_utils/osmosis_protobufs/txfees/types/gov.pb.go @@ -34,9 +34,9 @@ type UpdateFeeTokenProposal struct { Feetoken FeeToken `protobuf:"bytes,3,opt,name=feetoken,proto3" json:"feetoken" yaml:"fee_token"` } -func (m *UpdateFeeTokenProposal) Reset() { *m = UpdateFeeTokenProposal{} } +func (m *UpdateFeeTokenProposal) Reset() { *m = UpdateFeeTokenProposal{} } func (m *UpdateFeeTokenProposal) String() string { return proto.CompactTextString(m) } -func (*UpdateFeeTokenProposal) ProtoMessage() {} +func (*UpdateFeeTokenProposal) ProtoMessage() {} func (*UpdateFeeTokenProposal) Descriptor() ([]byte, []int) { return fileDescriptor_2c4a51bafc82863d, []int{0} } diff --git a/testutil/keeper/subscription.go b/testutil/keeper/subscription.go new file mode 100644 index 0000000000..59b2994679 --- /dev/null +++ b/testutil/keeper/subscription.go @@ -0,0 +1,52 @@ +package keeper + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + typesparams "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/lavanet/lava/x/subscription/keeper" + "github.com/lavanet/lava/x/subscription/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + tmdb "github.com/tendermint/tm-db" +) + +func SubscriptionKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { + storeKey := sdk.NewKVStoreKey(types.StoreKey) + memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) + + db := tmdb.NewMemDB() + stateStore := store.NewCommitMultiStore(db) + stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db) + stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil) + require.NoError(t, stateStore.LoadLatestVersion()) + + registry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(registry) + + paramsSubspace := typesparams.NewSubspace(cdc, + types.Amino, + storeKey, + memStoreKey, + "SubscriptionParams", + ) + k := keeper.NewKeeper( + cdc, + storeKey, + memStoreKey, + paramsSubspace, + ) + + ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger()) + + // Initialize params + k.SetParams(ctx, types.DefaultParams()) + + return k, ctx +} diff --git a/x/spec/keeper/spec_test.go b/x/spec/keeper/spec_test.go index 76af2c7dde..07f274d1c6 100644 --- a/x/spec/keeper/spec_test.go +++ b/x/spec/keeper/spec_test.go @@ -25,14 +25,14 @@ func prepareMockApis() []types.ServiceApi { mockApis[2*i] = api api.Enabled = false - mockApis[2*i + 1] = api + mockApis[2*i+1] = api } return mockApis } // selectMockApis returns a slice of ServiceApi corresponding to the given ids -func selectMockApis(apis []types.ServiceApi, ids []int) ([]types.ServiceApi) { +func selectMockApis(apis []types.ServiceApi, ids []int) []types.ServiceApi { var res []types.ServiceApi for _, i := range ids { @@ -95,7 +95,7 @@ func TestSpecGetAll(t *testing.T) { func prepareMockCurrentSpecs(keeper *keeper.Keeper, ctx sdk.Context, apis []types.ServiceApi) map[string]types.Spec { currentSpecs := make(map[string]types.Spec) - template := []struct{ + template := []struct { name string enabled bool imports []string @@ -124,7 +124,7 @@ func prepareMockCurrentSpecs(keeper *keeper.Keeper, ctx sdk.Context, apis []type // Note: the API identifiers below refer to the APIs from the // function prepareMockCurrentApis() above -var specTemplates = []struct{ +var specTemplates = []struct { desc string name string imports []string diff --git a/x/subscription/client/cli/query.go b/x/subscription/client/cli/query.go new file mode 100644 index 0000000000..6dc3a66e57 --- /dev/null +++ b/x/subscription/client/cli/query.go @@ -0,0 +1,31 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/lavanet/lava/x/subscription/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group subscription queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdQueryParams()) + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/subscription/client/cli/query_params.go b/x/subscription/client/cli/query_params.go new file mode 100644 index 0000000000..29edb28b47 --- /dev/null +++ b/x/subscription/client/cli/query_params.go @@ -0,0 +1,34 @@ +package cli + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/x/subscription/types" + "github.com/spf13/cobra" +) + +func CmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Short: "shows the parameters of the module", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/subscription/client/cli/tx.go b/x/subscription/client/cli/tx.go new file mode 100644 index 0000000000..328b7ed6d7 --- /dev/null +++ b/x/subscription/client/cli/tx.go @@ -0,0 +1,34 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/lavanet/lava/x/subscription/types" +) + +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" + listSeparator = "," +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/subscription/genesis.go b/x/subscription/genesis.go new file mode 100644 index 0000000000..42b655007c --- /dev/null +++ b/x/subscription/genesis.go @@ -0,0 +1,24 @@ +package subscription + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/subscription/keeper" + "github.com/lavanet/lava/x/subscription/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + genesis.Params = k.GetParams(ctx) + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/subscription/genesis_test.go b/x/subscription/genesis_test.go new file mode 100644 index 0000000000..18e09d96be --- /dev/null +++ b/x/subscription/genesis_test.go @@ -0,0 +1,29 @@ +package subscription_test + +import ( + "testing" + + keepertest "github.com/lavanet/lava/testutil/keeper" + "github.com/lavanet/lava/testutil/nullify" + "github.com/lavanet/lava/x/subscription" + "github.com/lavanet/lava/x/subscription/types" + "github.com/stretchr/testify/require" +) + +func TestGenesis(t *testing.T) { + genesisState := types.GenesisState{ + Params: types.DefaultParams(), + + // this line is used by starport scaffolding # genesis/test/state + } + + k, ctx := keepertest.SubscriptionKeeper(t) + subscription.InitGenesis(ctx, *k, genesisState) + got := subscription.ExportGenesis(ctx, *k) + require.NotNil(t, got) + + nullify.Fill(&genesisState) + nullify.Fill(got) + + // this line is used by starport scaffolding # genesis/test/assert +} diff --git a/x/subscription/handler.go b/x/subscription/handler.go new file mode 100644 index 0000000000..e307f78a7f --- /dev/null +++ b/x/subscription/handler.go @@ -0,0 +1,26 @@ +package subscription + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/lavanet/lava/x/subscription/keeper" + "github.com/lavanet/lava/x/subscription/types" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + // this line is used by starport scaffolding # handler/msgServer + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + _ = ctx.WithEventManager(sdk.NewEventManager()) + + switch msg := msg.(type) { + // this line is used by starport scaffolding # 1 + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/subscription/keeper/grpc_query.go b/x/subscription/keeper/grpc_query.go new file mode 100644 index 0000000000..5686188e62 --- /dev/null +++ b/x/subscription/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/lavanet/lava/x/subscription/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/subscription/keeper/grpc_query_params.go b/x/subscription/keeper/grpc_query_params.go new file mode 100644 index 0000000000..593cd6ab6a --- /dev/null +++ b/x/subscription/keeper/grpc_query_params.go @@ -0,0 +1,19 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/subscription/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil +} diff --git a/x/subscription/keeper/grpc_query_params_test.go b/x/subscription/keeper/grpc_query_params_test.go new file mode 100644 index 0000000000..58736a61e9 --- /dev/null +++ b/x/subscription/keeper/grpc_query_params_test.go @@ -0,0 +1,21 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + testkeeper "github.com/lavanet/lava/testutil/keeper" + "github.com/lavanet/lava/x/subscription/types" + "github.com/stretchr/testify/require" +) + +func TestParamsQuery(t *testing.T) { + keeper, ctx := testkeeper.SubscriptionKeeper(t) + wctx := sdk.WrapSDKContext(ctx) + params := types.DefaultParams() + keeper.SetParams(ctx, params) + + response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, &types.QueryParamsResponse{Params: params}, response) +} diff --git a/x/subscription/keeper/keeper.go b/x/subscription/keeper/keeper.go new file mode 100644 index 0000000000..0ded65eb46 --- /dev/null +++ b/x/subscription/keeper/keeper.go @@ -0,0 +1,44 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/lavanet/lava/x/subscription/types" +) + +type ( + Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace + } +) + +func NewKeeper( + cdc codec.BinaryCodec, + storeKey, + memKey sdk.StoreKey, + ps paramtypes.Subspace, +) *Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} diff --git a/x/subscription/keeper/msg_server.go b/x/subscription/keeper/msg_server.go new file mode 100644 index 0000000000..b1e4b66095 --- /dev/null +++ b/x/subscription/keeper/msg_server.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "github.com/lavanet/lava/x/subscription/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} diff --git a/x/subscription/keeper/msg_server_test.go b/x/subscription/keeper/msg_server_test.go new file mode 100644 index 0000000000..45c08d3df9 --- /dev/null +++ b/x/subscription/keeper/msg_server_test.go @@ -0,0 +1,16 @@ +package keeper_test + +import ( + "context" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/lavanet/lava/testutil/keeper" + "github.com/lavanet/lava/x/subscription/keeper" + "github.com/lavanet/lava/x/subscription/types" +) + +func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.SubscriptionKeeper(t) + return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +} diff --git a/x/subscription/keeper/params.go b/x/subscription/keeper/params.go new file mode 100644 index 0000000000..6e81b5224e --- /dev/null +++ b/x/subscription/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/lavanet/lava/x/subscription/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams() +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} diff --git a/x/subscription/keeper/params_test.go b/x/subscription/keeper/params_test.go new file mode 100644 index 0000000000..b5b03402fd --- /dev/null +++ b/x/subscription/keeper/params_test.go @@ -0,0 +1,18 @@ +package keeper_test + +import ( + "testing" + + testkeeper "github.com/lavanet/lava/testutil/keeper" + "github.com/lavanet/lava/x/subscription/types" + "github.com/stretchr/testify/require" +) + +func TestGetParams(t *testing.T) { + k, ctx := testkeeper.SubscriptionKeeper(t) + params := types.DefaultParams() + + k.SetParams(ctx, params) + + require.EqualValues(t, params, k.GetParams(ctx)) +} diff --git a/x/subscription/module.go b/x/subscription/module.go new file mode 100644 index 0000000000..199eb340c7 --- /dev/null +++ b/x/subscription/module.go @@ -0,0 +1,176 @@ +package subscription + +import ( + "encoding/json" + "fmt" + + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "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/lavanet/lava/x/subscription/client/cli" + "github.com/lavanet/lava/x/subscription/keeper" + "github.com/lavanet/lava/x/subscription/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/subscription/module_simulation.go b/x/subscription/module_simulation.go new file mode 100644 index 0000000000..d090bfc1c9 --- /dev/null +++ b/x/subscription/module_simulation.go @@ -0,0 +1,63 @@ +package subscription + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/simulation" + "github.com/lavanet/lava/testutil/sample" + subscriptionsimulation "github.com/lavanet/lava/x/subscription/simulation" + "github.com/lavanet/lava/x/subscription/types" +) + +// avoid unused import issue +var ( + _ = sample.AccAddress + _ = subscriptionsimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +const ( +// this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + subscriptionGenesis := types.GenesisState{ + Params: types.DefaultParams(), + // this line is used by starport scaffolding # simapp/module/genesisState + } + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&subscriptionGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + return []simtypes.ParamChange{} +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} diff --git a/x/subscription/simulation/simap.go b/x/subscription/simulation/simap.go new file mode 100644 index 0000000000..92c437c0d1 --- /dev/null +++ b/x/subscription/simulation/simap.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/subscription/types/codec.go b/x/subscription/types/codec.go new file mode 100644 index 0000000000..8883bdf684 --- /dev/null +++ b/x/subscription/types/codec.go @@ -0,0 +1,24 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/subscription/types/errors.go b/x/subscription/types/errors.go new file mode 100644 index 0000000000..8f024c2299 --- /dev/null +++ b/x/subscription/types/errors.go @@ -0,0 +1,12 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/subscription module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") +) diff --git a/x/subscription/types/expected_keepers.go b/x/subscription/types/expected_keepers.go new file mode 100644 index 0000000000..6aa6e97781 --- /dev/null +++ b/x/subscription/types/expected_keepers.go @@ -0,0 +1,18 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" +) + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI + // Methods imported from account should be defined here +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here +} diff --git a/x/subscription/types/genesis.go b/x/subscription/types/genesis.go new file mode 100644 index 0000000000..532bdecc79 --- /dev/null +++ b/x/subscription/types/genesis.go @@ -0,0 +1,22 @@ +package types + +// this line is used by starport scaffolding # genesis/types/import + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + Params: DefaultParams(), + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return gs.Params.Validate() +} diff --git a/x/subscription/types/genesis.pb.go b/x/subscription/types/genesis.pb.go new file mode 100644 index 0000000000..b48df09654 --- /dev/null +++ b/x/subscription/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: subscription/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the subscription module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +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_436ee45b4d54abbd, []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 init() { + proto.RegisterType((*GenesisState)(nil), "lavanet.lava.subscription.GenesisState") +} + +func init() { proto.RegisterFile("subscription/genesis.proto", fileDescriptor_436ee45b4d54abbd) } + +var fileDescriptor_436ee45b4d54abbd = []byte{ + // 193 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2a, 0x2e, 0x4d, 0x2a, + 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0xcc, 0xcf, 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xcc, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, + 0x03, 0xd1, 0x7a, 0xc8, 0x0a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xaa, 0xf4, 0x41, 0x2c, + 0x88, 0x06, 0x29, 0x49, 0x14, 0xc3, 0x0a, 0x12, 0x8b, 0x12, 0x73, 0xa1, 0x66, 0x29, 0xf9, 0x73, + 0xf1, 0xb8, 0x43, 0x0c, 0x0f, 0x2e, 0x49, 0x2c, 0x49, 0x15, 0xb2, 0xe7, 0x62, 0x83, 0xc8, 0x4b, + 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x29, 0xea, 0xe1, 0xb4, 0x4c, 0x2f, 0x00, 0xac, 0xd0, 0x89, + 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x36, 0x27, 0xb7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, + 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, + 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, + 0x87, 0x1a, 0x0a, 0xa6, 0xf5, 0x2b, 0xf4, 0x51, 0xdc, 0x57, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, + 0x06, 0x76, 0x9f, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x51, 0x43, 0xa6, 0x30, 0x09, 0x01, 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 + { + 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 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)) + 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 + 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/subscription/types/genesis_test.go b/x/subscription/types/genesis_test.go new file mode 100644 index 0000000000..3fdc672fca --- /dev/null +++ b/x/subscription/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/lavanet/lava/x/subscription/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/subscription/types/keys.go b/x/subscription/types/keys.go new file mode 100644 index 0000000000..340e64b5da --- /dev/null +++ b/x/subscription/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "subscription" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_subscription" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/subscription/types/params.go b/x/subscription/types/params.go new file mode 100644 index 0000000000..357196ad6a --- /dev/null +++ b/x/subscription/types/params.go @@ -0,0 +1,39 @@ +package types + +import ( + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/subscription/types/params.pb.go b/x/subscription/types/params.pb.go new file mode 100644 index 0000000000..6276f73144 --- /dev/null +++ b/x/subscription/types/params.pb.go @@ -0,0 +1,264 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: subscription/params.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_2e445ece5ef15599, []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 init() { + proto.RegisterType((*Params)(nil), "lavanet.lava.subscription.Params") +} + +func init() { proto.RegisterFile("subscription/params.proto", fileDescriptor_2e445ece5ef15599) } + +var fileDescriptor_2e445ece5ef15599 = []byte{ + // 152 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2c, 0x2e, 0x4d, 0x2a, + 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xcc, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x03, + 0xd1, 0x7a, 0xc8, 0xea, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xaa, 0xf4, 0x41, 0x2c, 0x88, + 0x06, 0x25, 0x3e, 0x2e, 0xb6, 0x00, 0xb0, 0x01, 0x56, 0x2c, 0x33, 0x16, 0xc8, 0x33, 0x38, 0xb9, + 0x9d, 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, 0x4e, 0x7a, 0x66, 0x49, 0x46, + 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0xd4, 0x16, 0x30, 0xad, 0x5f, 0xa1, 0x8f, 0xe2, 0x9e, + 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xf1, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x5d, 0xc5, 0xb8, 0xe7, 0xac, 0x00, 0x00, 0x00, +} + +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 + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(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 + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(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 ErrIntOverflowParams + } + 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 { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/subscription/types/query.pb.go b/x/subscription/types/query.pb.go new file mode 100644 index 0000000000..99441964ee --- /dev/null +++ b/x/subscription/types/query.pb.go @@ -0,0 +1,537 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: subscription/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_02ee11f15145221b, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_02ee11f15145221b, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "lavanet.lava.subscription.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "lavanet.lava.subscription.QueryParamsResponse") +} + +func init() { proto.RegisterFile("subscription/query.proto", fileDescriptor_02ee11f15145221b) } + +var fileDescriptor_02ee11f15145221b = []byte{ + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0x87, 0x63, 0x04, 0x1d, 0xcc, 0x66, 0x3a, 0xb4, 0x15, 0x32, 0xb4, 0x2c, 0x80, 0xc0, 0x56, + 0xcb, 0x03, 0x20, 0x75, 0x60, 0x86, 0x0e, 0x0c, 0x6c, 0x4e, 0x65, 0x99, 0x48, 0x8d, 0xcf, 0x8d, + 0x9d, 0x8a, 0xae, 0x3c, 0x01, 0x82, 0x95, 0x07, 0xea, 0x58, 0x89, 0x85, 0x09, 0xa1, 0x84, 0x07, + 0x41, 0xb1, 0x33, 0x10, 0xf1, 0x47, 0x4c, 0x67, 0x9d, 0xbf, 0xef, 0xe7, 0xf3, 0xe1, 0x8e, 0xcd, + 0x63, 0x3b, 0xcd, 0x12, 0xe3, 0x12, 0xd0, 0x7c, 0x9e, 0xcb, 0x6c, 0xc9, 0x4c, 0x06, 0x0e, 0x48, + 0x77, 0x26, 0x16, 0x42, 0x4b, 0xc7, 0xaa, 0xca, 0xbe, 0x62, 0xbd, 0xb6, 0x02, 0x05, 0x9e, 0xe2, + 0xd5, 0x29, 0x08, 0xbd, 0x5d, 0x05, 0xa0, 0x66, 0x92, 0x0b, 0x93, 0x70, 0xa1, 0x35, 0x38, 0x51, + 0xc1, 0xb6, 0xbe, 0x3d, 0x9e, 0x82, 0x4d, 0xc1, 0xf2, 0x58, 0x58, 0x19, 0xde, 0xe1, 0x8b, 0x61, + 0x2c, 0x9d, 0x18, 0x72, 0x23, 0x54, 0xa2, 0x3d, 0x5c, 0xb3, 0xdd, 0xc6, 0x50, 0x46, 0x64, 0x22, + 0xad, 0x63, 0x06, 0x6d, 0x4c, 0xae, 0x2a, 0xf9, 0xd2, 0x37, 0x27, 0x72, 0x9e, 0x4b, 0xeb, 0x06, + 0xd7, 0x78, 0xa7, 0xd1, 0xb5, 0x06, 0xb4, 0x95, 0xe4, 0x1c, 0xb7, 0x82, 0xdc, 0x41, 0xfb, 0xe8, + 0x70, 0x7b, 0xd4, 0x67, 0xbf, 0xfe, 0x89, 0x05, 0x75, 0xbc, 0xb9, 0x7a, 0xdb, 0x8b, 0x26, 0xb5, + 0x36, 0x7a, 0x46, 0x78, 0xcb, 0x07, 0x93, 0x47, 0x84, 0x5b, 0x01, 0x21, 0xa7, 0x7f, 0xa4, 0x7c, + 0x9f, 0xad, 0xc7, 0xfe, 0x8b, 0x87, 0xa1, 0x07, 0x47, 0xf7, 0x2f, 0x1f, 0x4f, 0x1b, 0x07, 0xa4, + 0xcf, 0x6b, 0xcf, 0x57, 0xfe, 0xc3, 0x4a, 0xc6, 0x17, 0xab, 0x82, 0xa2, 0x75, 0x41, 0xd1, 0x7b, + 0x41, 0xd1, 0x43, 0x49, 0xa3, 0x75, 0x49, 0xa3, 0xd7, 0x92, 0x46, 0x37, 0x27, 0x2a, 0x71, 0xb7, + 0x79, 0xcc, 0xa6, 0x90, 0x36, 0x63, 0xee, 0x9a, 0x41, 0x6e, 0x69, 0xa4, 0x8d, 0x5b, 0x7e, 0xb7, + 0x67, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x66, 0x37, 0x48, 0x2b, 0x0d, 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 { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/lavanet.lava.subscription.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Parameters queries the parameters of the module. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/lavanet.lava.subscription.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "lavanet.lava.subscription.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "subscription/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) 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 = 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 *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.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 *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: 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 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 err := m.Params.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/subscription/types/query.pb.gw.go b/x/subscription/types/query.pb.gw.go new file mode 100644 index 0000000000..703451c801 --- /dev/null +++ b/x/subscription/types/query.pb.gw.go @@ -0,0 +1,153 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: subscription/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_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(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_Params_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_Params_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_Params_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_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"lavanet", "lava", "subscription", "params"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage +) diff --git a/x/subscription/types/tx.pb.go b/x/subscription/types/tx.pb.go new file mode 100644 index 0000000000..e1258b1e5e --- /dev/null +++ b/x/subscription/types/tx.pb.go @@ -0,0 +1,80 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: subscription/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + math "math" +) + +// 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 + +func init() { proto.RegisterFile("subscription/tx.proto", fileDescriptor_cc8b79a0f6744252) } + +var fileDescriptor_cc8b79a0f6744252 = []byte{ + // 127 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x2e, 0x4d, 0x2a, + 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x92, 0xcc, 0x49, 0x2c, 0x4b, 0xcc, 0x4b, 0x2d, 0xd1, 0x03, 0xd1, 0x7a, 0xc8, 0x6a, + 0x8c, 0x58, 0xb9, 0x98, 0x7d, 0x8b, 0xd3, 0x9d, 0xdc, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, + 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, + 0x58, 0x8e, 0x21, 0x4a, 0x27, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, + 0x6a, 0x0c, 0x98, 0xd6, 0xaf, 0xd0, 0x47, 0xb5, 0xac, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x6c, + 0xa1, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x79, 0x58, 0x7c, 0xa8, 0x89, 0x00, 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 { +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "lavanet.lava.subscription.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "subscription/tx.proto", +} diff --git a/x/subscription/types/types.go b/x/subscription/types/types.go new file mode 100644 index 0000000000..ab1254f4c2 --- /dev/null +++ b/x/subscription/types/types.go @@ -0,0 +1 @@ +package types