basic provider fund locking implementation

This commit is contained in:
2022-09-07 23:06:55 +00:00
parent c9f73980ae
commit c85bbaca1f
5 changed files with 132 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ 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"
@@ -14,9 +15,9 @@ var _ = strconv.Itoa(0)
func CmdLockFunds() *cobra.Command {
cmd := &cobra.Command{
Use: "lock-funds",
Use: "lock-funds [amount in uCLR]",
Short: "Broadcast message lockFunds",
Args: cobra.ExactArgs(0),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientTxContext(cmd)
@@ -24,8 +25,11 @@ func CmdLockFunds() *cobra.Command {
return err
}
argAmount := args[0]
msg := types.NewMsgLockFunds(
clientCtx.GetFromAddress().String(),
argAmount,
)
if err := msg.ValidateBasic(); err != nil {
return err