-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.go
54 lines (47 loc) · 1.67 KB
/
cli.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package cli
import (
"github.com/brc20-collab/brczero/libs/cosmos-sdk/client"
"github.com/brc20-collab/brczero/libs/cosmos-sdk/codec"
interfacetypes "github.com/brc20-collab/brczero/libs/cosmos-sdk/codec/types"
"github.com/brc20-collab/brczero/libs/ibc-go/modules/core/02-client/types"
"github.com/spf13/cobra"
)
// GetQueryCmd returns the query commands for IBC clients
func GetQueryCmd(cdc *codec.CodecProxy, reg interfacetypes.InterfaceRegistry) *cobra.Command {
queryCmd := &cobra.Command{
Use: types.SubModuleName,
Short: "IBC client query subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
queryCmd.AddCommand(
GetCmdQueryClientStates(cdc, reg),
GetCmdQueryClientState(cdc, reg),
GetCmdQueryClientStatus(cdc, reg),
GetCmdQueryConsensusStates(cdc, reg),
GetCmdQueryConsensusStateHeights(cdc, reg),
GetCmdQueryConsensusState(cdc, reg),
GetCmdQueryHeader(cdc, reg),
GetCmdSelfConsensusState(cdc, reg),
GetCmdParams(cdc, reg),
)
return queryCmd
}
// NewTxCmd returns the command to create and handle IBC clients
func NewTxCmd(cdc *codec.CodecProxy, reg interfacetypes.InterfaceRegistry) *cobra.Command {
txCmd := &cobra.Command{
Use: types.SubModuleName,
Short: "IBC client transaction subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
txCmd.AddCommand(
NewCreateClientCmd(cdc, reg),
NewUpdateClientCmd(cdc, reg),
NewSubmitMisbehaviourCmd(cdc, reg),
NewUpgradeClientCmd(cdc, reg),
)
return txCmd
}