Skip to content

Commit 7f81583

Browse files
committed
feat: add funds to account init cli
1 parent e8cbdda commit 7f81583

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

x/accounts/cli/cli.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/cosmos/cosmos-sdk/client/flags"
1616
"github.com/cosmos/cosmos-sdk/client/tx"
1717
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
18+
sdk "github.com/cosmos/cosmos-sdk/types"
1819
)
1920

2021
func TxCmd(name string) *cobra.Command {
@@ -41,9 +42,9 @@ func QueryCmd(name string) *cobra.Command {
4142

4243
func GetTxInitCmd() *cobra.Command {
4344
cmd := &cobra.Command{
44-
Use: "init <account-type> <json-message>",
45+
Use: "init <account-type> <json-message> <fund>[,<fund>...]",
4546
Short: "Initialize a new account",
46-
Args: cobra.ExactArgs(2),
47+
Args: cobra.ExactArgs(3),
4748
RunE: func(cmd *cobra.Command, args []string) error {
4849
clientCtx, err := client.GetClientTxContext(cmd)
4950
if err != nil {
@@ -69,10 +70,15 @@ func GetTxInitCmd() *cobra.Command {
6970
if err != nil {
7071
return err
7172
}
73+
funds, err := sdk.ParseCoinsNormalized(args[2])
74+
if err != nil {
75+
return err
76+
}
7277
msg := v1.MsgInit{
7378
Sender: sender,
7479
AccountType: args[0],
7580
Message: msgBytes,
81+
Funds: funds,
7682
}
7783

7884
isGenesis, err := cmd.Flags().GetBool("genesis")

0 commit comments

Comments
 (0)