func NewMsgEditValidator(valAddr chainTypes.AccountID, description Description, newRate *sdk.Dec) MsgEditValidator {
	return MsgEditValidator{
		Description:      description,
		CommissionRate:   newRate,
		ValidatorAccount: valAddr,
	}
}
NewMsgEditValidator creates a new MsgEditValidator instance
package types
import (
	chainTypes "github.com/KuChainNetwork/kuchain/chain/types"
	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
	"github.com/tendermint/tendermint/crypto"
)
var _, _, _, _, _ chainTypes.KuMsgData = (*MsgCreateValidator)(nil), (*MsgEditValidator)(nil), (*MsgDelegate)(nil), (*MsgBeginRedelegate)(nil), (*MsgUndelegate)(nil)
type MsgCreateValidator struct {
	Description      Description `json:"description" yaml:"description"`
	CommissionRates  Dec         `json:"CommissionRates" yaml:"commission_rate"`
	ValidatorAccount AccountID   `json:"validator_account" yaml:"validator_account"`
	DelegatorAccount AccountID   `json:"delegator_account" yaml:"delegator_account"`
	Pubkey           string      `json:"pubkey,omitempty" yaml:"pubkey"`
}
func NewMsgCreateValidator(
	valAddr chainTypes.AccountID, pubKey crypto.PubKey,
	description Description, commission sdk.Dec, delAcc chainTypes.AccountID,
) MsgCreateValidator {
	var pkStr string
	if pubKey != nil {
		pkStr = sdk.MustBech32ifyPubKey(sdk.Bech32PubKeyTypeConsPub, pubKey)
	}
	return MsgCreateValidator{
		Description:      description,
		ValidatorAccount: valAddr,
		Pubkey:           pkStr,
		DelegatorAccount: delAcc,
		CommissionRates:  commission,
	}
}
func (msg MsgCreateValidator) Route() string { return RouterKey }
func (MsgCreateValidator) Type() chainTypes.Name { return chainTypes.MustName("create@staking") }
func (msg MsgCreateValidator) Sender() AccountID {
	return msg.ValidatorAccount
}
func (msg MsgCreateValidator) GetSigners() []sdk.AccAddress {
	addrs := []sdk.AccAddress{}
	delegatorAccAddress, ok := msg.DelegatorAccount.ToAccAddress()
	if ok {  
		addrs = append(addrs, delegatorAccAddress)
	}
	return addrs
}
func (msg MsgCreateValidator) GetSignBytes() []byte {
	bz := ModuleCdc.MustMarshalJSON(msg)
	return sdk.MustSortJSON(bz)
}
func (msg MsgCreateValidator) ValidateBasic() error {
	if msg.DelegatorAccount.Empty() {
		return ErrEmptyDelegatorAddr
	}
	if msg.ValidatorAccount.Empty() {
		return ErrEmptyValidatorAddr
	}
	if msg.Pubkey == "" {
		return ErrEmptyValidatorPubKey
	}
	if msg.Description == (Description{}) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "empty description")
	}
	if msg.CommissionRates.IsNegative() {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "commission_rate is negative")
	}
	if msg.CommissionRates.GT(sdk.OneDec()) {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "commission_rate is greater then 1")
	}
	return nil
}
type MsgEditValidator struct {
	Description      Description `json:"description" yaml:"description"`
	ValidatorAccount AccountID   `json:"validator_account" yaml:"address"`
	CommissionRate   *Dec        `json:"commission_rate,omitempty" yaml:"commission_rate"`
}