mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-03 04:36:41 +00:00

* added signing authority (dao) to the keeper to enable dao signing checks * added UpdateParam message for the machine module --------- Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
49 lines
1022 B
Go
49 lines
1022 B
Go
package cli
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"encoding/json"
|
|
|
|
"github.com/cosmos/cosmos-sdk/client"
|
|
"github.com/cosmos/cosmos-sdk/client/flags"
|
|
"github.com/cosmos/cosmos-sdk/client/tx"
|
|
"github.com/planetmint/planetmint-go/x/machine/types"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var _ = strconv.Itoa(0)
|
|
|
|
func CmdUpdateParams() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "update-params [params]",
|
|
Short: "Broadcast message UpdateParams",
|
|
Args: cobra.ExactArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
|
argParams := new(types.Params)
|
|
err = json.Unmarshal([]byte(args[0]), argParams)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
clientCtx, err := client.GetClientTxContext(cmd)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
msg := types.NewMsgUpdateParams(
|
|
clientCtx.GetFromAddress().String(),
|
|
*argParams,
|
|
)
|
|
if err := msg.ValidateBasic(); err != nil {
|
|
return err
|
|
}
|
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
|
|
},
|
|
}
|
|
|
|
flags.AddTxFlagsToCmd(cmd)
|
|
|
|
return cmd
|
|
}
|