basic linear vesting payouts (manual claim)

This commit is contained in:
2022-09-14 21:36:30 +00:00
parent edba09b124
commit 7f71e0be9e
15 changed files with 689 additions and 33 deletions

View File

@@ -35,6 +35,7 @@ func GetTxCmd() *cobra.Command {
cmd.AddCommand(CmdLockFunds())
cmd.AddCommand(CmdUnlockFunds())
cmd.AddCommand(CmdUnlockAllFunds())
cmd.AddCommand(CmdClaimFunds())
// this line is used by starport scaffolding # 1
return cmd

View 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 CmdClaimFunds() *cobra.Command {
cmd := &cobra.Command{
Use: "claim-funds [auction-id]",
Short: "Broadcast message claimFunds",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
argAuctionId := args[0]
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
msg := types.NewMsgClaimFunds(
clientCtx.GetFromAddress().String(),
argAuctionId,
)
if err := msg.ValidateBasic(); err != nil {
return err
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}
flags.AddTxFlagsToCmd(cmd)
return cmd
}