func (msg MsgCreatePost) MarshalJSON() ([]byte, error) {
	type temp MsgCreatePost
	return json.Marshal(temp(msg))
}
MarshalJSON implements the json.Mashaler interface.
This is done due to the fact that Amino does not respect omitempty clauses
package types
import (
	"encoding/json"
	"strings"
	subspacestypes "github.com/desmos-labs/desmos/v2/x/staging/subspaces/types"
	emoji "github.com/desmos-labs/Go-Emoji-Utils"
	commonerrors "github.com/desmos-labs/desmos/v2/x/commons/types/errors"
	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
	"github.com/desmos-labs/desmos/v2/x/commons"
)
func NewMsgCreatePost(
	message string, parentID string, commentsState CommentsState, subspace string,
	additionalAttributes []Attribute, owner string, attachments Attachments, poll *Poll,
) *MsgCreatePost {
	return &MsgCreatePost{
		Message:              message,
		ParentID:             parentID,
		CommentsState:        commentsState,
		Subspace:             subspace,
		AdditionalAttributes: additionalAttributes,
		Creator:              owner,
		Attachments:          attachments,
		Poll:                 poll,
	}
}
func (msg MsgCreatePost) Route() string { return RouterKey }
func (msg MsgCreatePost) Type() string { return ActionCreatePost }
func (msg MsgCreatePost) ValidateBasic() error {
	_, err := sdk.AccAddressFromBech32(msg.Creator)
	if err != nil {
		return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator")
	}
	if msg.ParentID != "" && !IsValidPostID(msg.ParentID) {
		return sdkerrors.Wrap(ErrInvalidPostID, msg.ParentID)
	}
	if len(strings.TrimSpace(msg.Message)) == 0 && len(msg.Attachments) == 0 && msg.Poll == nil {
		return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest,
			"post message, attachments or poll are required and cannot be all blank or empty")
	}
	if !subspacestypes.IsValidSubspace(msg.Subspace) {
		return sdkerrors.Wrap(ErrInvalidSubspace, "post subspace must be a valid sha-256 hash")
	}
	for _, attachment := range msg.Attachments {
		err := attachment.Validate()
		if err != nil {
			return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
		}
	}
	if msg.Poll != nil {
		if err := msg.Poll.Validate(); err != nil {
			return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error())
		}
	}
	return nil
}
func (msg MsgCreatePost) GetSignBytes() []byte {
	return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg))
}
func (msg MsgCreatePost) GetSigners() []sdk.AccAddress {
	addr, _ := sdk.AccAddressFromBech32(msg.Creator)
	return []sdk.AccAddress{addr}
}