mirror of
https://github.com/colinear-labs/chain.git
synced 2026-03-05 04:34:26 -08:00
scaffold locked-funds query
This commit is contained in:
@@ -31,6 +31,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
|
||||
cmd.AddCommand(CmdAuctionBids())
|
||||
|
||||
cmd.AddCommand(CmdShowLockedUsers())
|
||||
cmd.AddCommand(CmdLockedFunds())
|
||||
|
||||
// this line is used by starport scaffolding # 1
|
||||
|
||||
return cmd
|
||||
|
||||
46
x/colinearcore/client/cli/query_locked_funds.go
Normal file
46
x/colinearcore/client/cli/query_locked_funds.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"colinear/x/colinearcore/types"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var _ = strconv.Itoa(0)
|
||||
|
||||
func CmdLockedFunds() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "locked-funds [owner]",
|
||||
Short: "Query lockedFunds",
|
||||
Args: cobra.ExactArgs(1),
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
reqOwner := args[0]
|
||||
|
||||
clientCtx, err := client.GetClientTxContext(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
queryClient := types.NewQueryClient(clientCtx)
|
||||
|
||||
params := &types.QueryLockedFundsRequest{
|
||||
|
||||
Owner: reqOwner,
|
||||
}
|
||||
|
||||
res, err := queryClient.LockedFunds(cmd.Context(), params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return clientCtx.PrintProto(res)
|
||||
},
|
||||
}
|
||||
|
||||
flags.AddQueryFlagsToCmd(cmd)
|
||||
|
||||
return cmd
|
||||
}
|
||||
Reference in New Issue
Block a user