You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
750 B
28 lines
750 B
package cmd
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/woop-chain/go-sdk/pkg/rpc"
|
|
)
|
|
|
|
var (
|
|
delegationSubCmds = []*cobra.Command{{
|
|
Use: "by-delegator",
|
|
Short: "Get all delegations by a delegator",
|
|
Args: cobra.ExactArgs(1),
|
|
PreRunE: validateAddress,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
noLatest = true
|
|
return request(rpc.Method.GetDelegationsByDelegator, []interface{}{addr.address})
|
|
},
|
|
}, {
|
|
Use: "by-validator",
|
|
Short: "Get all delegations for a validator",
|
|
Args: cobra.ExactArgs(1),
|
|
PreRunE: validateAddress,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
noLatest = true
|
|
return request(rpc.Method.GetDelegationsByValidator, []interface{}{addr.address})
|
|
},
|
|
}}
|
|
)
|
|
|