block-sdk/x/auction/client/cli/query.go
Alex Johnson f1cde2acec
fix: mempool lane size check on CheckTx (#561)
* push

* init

* fix setup

* format

* fix test

* use lane

* ok

* finalize

* fix everything

* lint fix:

* Update abci/checktx/mempool_parity_check_tx.go

Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>

* lint fix

* tidy

* remove

* cleanup

---------

Co-authored-by: David Terpay <david.terpay@gmail.com>
Co-authored-by: David Terpay <35130517+davidterpay@users.noreply.github.com>
2024-07-02 19:19:22 -04:00

59 lines
1.4 KiB
Go

package cli
import (
"context"
"fmt"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
"github.com/skip-mev/block-sdk/v2/x/auction/types"
)
// GetQueryCmd returns the cli query commands for the auction module.
func GetQueryCmd() *cobra.Command {
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(),
)
return cmd
}
// CmdQueryParams implements a command that will return the current parameters of the auction module.
func CmdQueryParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "Query the current parameters of the auction module",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)
request := &types.QueryParamsRequest{}
response, err := queryClient.Params(context.Background(), request)
if err != nil {
return err
}
return clientCtx.PrintProto(&response.Params)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}