mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 04:44:25 -08:00
scaffold unlock-funds message
This commit is contained in:
@@ -33,6 +33,7 @@ func GetTxCmd() *cobra.Command {
|
||||
cmd.AddCommand(CmdNewAuction())
|
||||
cmd.AddCommand(CmdNewBid())
|
||||
cmd.AddCommand(CmdLockFunds())
|
||||
cmd.AddCommand(CmdUnlockFunds())
|
||||
// this line is used by starport scaffolding # 1
|
||||
|
||||
return cmd
|
||||
|
||||
42
x/colinearcore/client/cli/tx_unlock_funds.go
Normal file
42
x/colinearcore/client/cli/tx_unlock_funds.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"colinear/x/colinearcore/types"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/cosmos/cosmos-sdk/client/tx"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var _ = strconv.Itoa(0)
|
||||
|
||||
func CmdUnlockFunds() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "unlock-funds [amount]",
|
||||
Short: "Broadcast message unlockFunds",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
argAmount := args[0]
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
msg := types.NewMsgUnlockFunds(
|
||||
clientCtx.GetFromAddress().String(),
|
||||
argAmount,
|
||||
)
|
||||
if err := msg.ValidateBasic(); err != nil {
|
||||
return err
|
||||
}
|
||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddTxFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user