Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport genesis for RL #4408

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/keepers/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
transfer "github.com/cosmos/ibc-go/v4/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v4/modules/core"
ibcclientclient "github.com/cosmos/ibc-go/v4/modules/core/02-client/client"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/ibcratelimitmodule"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand All @@ -31,7 +32,6 @@ import (
downtimemodule "github.com/osmosis-labs/osmosis/v14/x/downtime-detector/module"
"github.com/osmosis-labs/osmosis/v14/x/epochs"
"github.com/osmosis-labs/osmosis/v14/x/gamm"
ibc_rate_limit "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit"
"github.com/osmosis-labs/osmosis/v14/x/incentives"
"github.com/osmosis-labs/osmosis/v14/x/lockup"
"github.com/osmosis-labs/osmosis/v14/x/mint"
Expand Down Expand Up @@ -92,5 +92,5 @@ var AppModuleBasics = []module.AppModuleBasic{
wasm.AppModuleBasic{},
ica.AppModuleBasic{},
ibc_hooks.AppModuleBasic{},
ibc_rate_limit.AppModuleBasic{},
ibcratelimitmodule.AppModuleBasic{},
}
15 changes: 15 additions & 0 deletions proto/osmosis/ibc-rate-limit/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package osmosis.ibcratelimit.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/any.proto";
import "osmosis/ibc-rate-limit/v1beta1/params.proto";

option go_package = "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/types";

// GenesisState defines the ibc-rate-limit module's genesis state.
message GenesisState {
// params are all the parameters of the module
Params params = 1 [ (gogoproto.nullable) = false ];
}
12 changes: 6 additions & 6 deletions proto/osmosis/ibc-rate-limit/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "osmosis/ibc-rate-limit/v1beta1/params.proto";

option go_package = "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/types";
option go_package = "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/client/queryproto";

// Query defines the gRPC querier service.
service Query {
// Params defines a gRPC query method that returns the ibc-rate-limit module's
// parameters.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
rpc Params(ParamsRequest) returns (ParamsResponse) {
option (google.api.http).get = "/osmosis/ibc-rate-limit/v1beta1/params";
}
}

// QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}
// ParamsRequest is the request type for the Query/Params RPC method.
message ParamsRequest {}

// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// aramsResponse is the response type for the Query/Params RPC method.
message ParamsResponse {
// params defines the parameters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];
}
10 changes: 10 additions & 0 deletions proto/osmosis/ibc-rate-limit/v1beta1/query.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
keeper:
path: "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit"
struct: "Keeper"
client_path: "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/client"
queries:
Params:
proto_wrapper:
query_func: "k.GetParams"
cli:
cmd: "GetParams"
5 changes: 3 additions & 2 deletions x/ibc-rate-limit/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"

"github.com/osmosis-labs/osmosis/osmoutils/osmocli"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/client/queryproto"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/types"
)

Expand All @@ -12,8 +13,8 @@ func GetQueryCmd() *cobra.Command {
cmd := osmocli.QueryIndexCmd(types.ModuleName)

cmd.AddCommand(
osmocli.GetParams[*types.QueryParamsRequest](
types.ModuleName, types.NewQueryClient),
osmocli.GetParams[*queryproto.ParamsRequest](
types.ModuleName, queryproto.NewQueryClient),
)

return cmd
Expand Down
32 changes: 32 additions & 0 deletions x/ibc-rate-limit/client/grpc/grpc_query.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package grpc

// THIS FILE IS GENERATED CODE, DO NOT EDIT
// SOURCE AT `proto/osmosis/ibc-rate-limit/v1beta1/query.yml`

import (
context "context"

"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/client"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/client/queryproto"
)

type Querier struct {
Q client.Querier
}

var _ queryproto.QueryServer = Querier{}

func (q Querier) Params(grpcCtx context.Context,
req *queryproto.ParamsRequest,
) (*queryproto.ParamsResponse, error) {
if req == nil {
return nil, status.Error(codes.InvalidArgument, "empty request")
}
ctx := sdk.UnwrapSDKContext(grpcCtx)
return q.Q.Params(ctx, *req)
}

21 changes: 21 additions & 0 deletions x/ibc-rate-limit/client/query_proto_wrap.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package client

import (
sdk "github.com/cosmos/cosmos-sdk/types"

ibcratelimit "github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit"
"github.com/osmosis-labs/osmosis/v14/x/ibc-rate-limit/client/queryproto"
)

// This file should evolve to being code gen'd, off of `proto/twap/v1beta/query.yml`

type Querier struct {
K ibcratelimit.ICS4Wrapper
}

func (q Querier) Params(ctx sdk.Context,
req queryproto.ParamsRequest,
) (*queryproto.ParamsResponse, error) {
params := q.K.GetParams(ctx)
return &queryproto.ParamsResponse{Params: params}, nil
}
Loading