-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
module_client.go
47 lines (39 loc) · 1.15 KB
/
module_client.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
package clientpackage
import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/mint/client/cli"
"github.com/spf13/cobra"
"github.com/tendermint/go-amino"
)
// ModuleClient exports all CLI client functionality from the minting module.
type ModuleClient struct {
storeKey string
cdc *amino.Codec
}
func NewModuleClient(storeKey string, cdc *amino.Codec) ModuleClient {
return ModuleClient{storeKey, cdc}
}
// GetQueryCmd returns the cli query commands for the minting module.
func (mc ModuleClient) GetQueryCmd() *cobra.Command {
mintingQueryCmd := &cobra.Command{
Use: mint.ModuleName,
Short: "Querying commands for the minting module",
}
mintingQueryCmd.AddCommand(
client.GetCommands(
cli.GetCmdQueryParams(mc.cdc),
cli.GetCmdQueryInflation(mc.cdc),
cli.GetCmdQueryAnnualProvisions(mc.cdc),
)...,
)
return mintingQueryCmd
}
// GetTxCmd returns the transaction commands for the minting module.
func (mc ModuleClient) GetTxCmd() *cobra.Command {
mintTxCmd := &cobra.Command{
Use: mint.ModuleName,
Short: "Minting transaction subcommands",
}
return mintTxCmd
}