func sendMsgReportPost(
	r *rand.Rand, app *baseapp.BaseApp, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper,
	msg *types.MsgReportPost, ctx sdk.Context, chainID string, privkeys []cryptotypes.PrivKey,
) error {
	addr, _ := sdk.AccAddressFromBech32(msg.User)
	account := ak.GetAccount(ctx, addr)
	coins := bk.SpendableCoins(ctx, account.GetAddress())
	fees, err := simtypes.RandomFees(r, ctx, coins)
	if err != nil {
		return err
	}
	txGen := simappparams.MakeTestEncodingConfig().TxConfig
	tx, err := helpers.GenTx(
		txGen,
		[]sdk.Msg{msg},
		fees,
		DefaultGasValue,
		chainID,
		[]uint64{account.GetAccountNumber()},
		[]uint64{account.GetSequence()},
		privkeys...,
	)
	if err != nil {
		return err
	}
	_, _, err = app.Deliver(txGen.TxEncoder(), tx)
	if err != nil {
		return err
	}
	return nil
}
sendMsgReportPost sends a transaction with a MsgReportPost from a provided random account.
package simulation
import (
	"math/rand"
	simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
	simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
	authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
	bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
	"github.com/cosmos/cosmos-sdk/baseapp"
	cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
	"github.com/cosmos/cosmos-sdk/simapp/helpers"
	sdk "github.com/cosmos/cosmos-sdk/types"
	postskeeper "github.com/desmos-labs/desmos/v2/x/staging/posts/keeper"
	"github.com/desmos-labs/desmos/v2/x/staging/posts/types"
)
func SimulateMsgReportPost(
	pk postskeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper,
) simtypes.Operation {
	return func(
		r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
	) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
		data, skip := randomReportPostFields(r, ctx, accs, ak, pk)
		if skip {
			return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgReportPost"), nil, nil
		}
		msg := types.NewMsgReportPost(
			data.PostID,
			data.Type,
			data.Message,
			data.Creator.Address.String(),
		)
		err := sendMsgReportPost(r, app, ak, bk, msg, ctx, chainID, []cryptotypes.PrivKey{data.Creator.PrivKey})
		if err != nil {
			return simtypes.NoOpMsg(types.RouterKey, types.ModuleName, "MsgReportPost"), nil, err
		}
		return simtypes.NewOperationMsg(msg, true, "MsgReportPost", nil), nil, nil
	}
}