-
Notifications
You must be signed in to change notification settings - Fork 0
/
tx.go
33 lines (27 loc) · 831 Bytes
/
tx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cli
import (
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/coinexchain/cet-sdk/modules/authx/internal/types"
"github.com/coinexchain/cosmos-utils/client/cliutil"
)
func SetRefereeCmd(cdc *codec.Codec) *cobra.Command {
cmd := &cobra.Command{
Use: "set-referee <referee address>",
Short: "Set referee address to earn trading fees",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
referee, err := sdk.AccAddressFromBech32(args[0])
if err != nil {
return err
}
msg := types.NewMsgSetReferee(nil, referee)
return cliutil.CliRunCommand(cdc, &msg)
},
}
cmd = client.PostCommands(cmd)[0]
_ = cmd.MarkFlagRequired(client.FlagFrom)
return cmd
}