From 47861d7a817b1aa03df27d8ac79d448bd6da1e38 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Tue, 6 Feb 2024 16:08:08 +0000 Subject: [PATCH] refactor(dogfood): remove not required items --- x/dogfood/client/cli/query.go | 28 ++++++++++++++++++++++ x/dogfood/client/cli/query_params.go | 36 ---------------------------- x/dogfood/client/cli/tx.go | 12 ---------- x/dogfood/types/keys.go | 7 ------ 4 files changed, 28 insertions(+), 55 deletions(-) delete mode 100644 x/dogfood/client/cli/query_params.go diff --git a/x/dogfood/client/cli/query.go b/x/dogfood/client/cli/query.go index 41b496df3..a4dfc065d 100644 --- a/x/dogfood/client/cli/query.go +++ b/x/dogfood/client/cli/query.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" @@ -31,3 +32,30 @@ func GetQueryCmd(queryRoute string) *cobra.Command { return cmd } + +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, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/dogfood/client/cli/query_params.go b/x/dogfood/client/cli/query_params.go deleted file mode 100644 index f5f252819..000000000 --- a/x/dogfood/client/cli/query_params.go +++ /dev/null @@ -1,36 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/dogfood/types" -) - -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, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/dogfood/client/cli/tx.go b/x/dogfood/client/cli/tx.go index ed092de4d..06c36befa 100644 --- a/x/dogfood/client/cli/tx.go +++ b/x/dogfood/client/cli/tx.go @@ -2,7 +2,6 @@ package cli import ( "fmt" - "time" "github.com/spf13/cobra" @@ -11,17 +10,6 @@ import ( "github.com/ExocoreNetwork/exocore/x/dogfood/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{ diff --git a/x/dogfood/types/keys.go b/x/dogfood/types/keys.go index 1a9e60990..1256e87e4 100644 --- a/x/dogfood/types/keys.go +++ b/x/dogfood/types/keys.go @@ -6,11 +6,4 @@ const ( // StoreKey defines the primary module store key StoreKey = ModuleName - - // RouterKey defines the module's message routing key - RouterKey = ModuleName ) - -func KeyPrefix(p string) []byte { - return []byte(p) -}