wormhole/wormchain/x/wormhole/client/cli/query_config.go

37 lines
742 B
Go

package cli
import (
"context"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
"github.com/wormhole-foundation/wormchain/x/wormhole/types"
)
func CmdShowConfig() *cobra.Command {
cmd := &cobra.Command{
Use: "show-config",
Short: "shows Config",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx := client.GetClientContextFromCmd(cmd)
queryClient := types.NewQueryClient(clientCtx)
params := &types.QueryGetConfigRequest{}
res, err := queryClient.Config(context.Background(), params)
if err != nil {
return err
}
return clientCtx.PrintProto(res)
},
}
flags.AddQueryFlagsToCmd(cmd)
return cmd
}