{"modulePath":"github.com/RAMPAGEXP/ethermint","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package simulation\n\n## Constants\n\n```go\nconst (\n\t/* #nosec */\n\tOpWeightMsgEthSimpleTransfer = \"op_weight_msg_eth_simple_transfer\"\n\t/* #nosec */\n\tOpWeightMsgEthCreateContract = \"op_weight_msg_eth_create_contract\"\n\t/* #nosec */\n\tOpWeightMsgEthCallContract = \"op_weight_msg_eth_call_contract\"\n)\n```\n\n```go\nconst (\n\tWeightMsgEthSimpleTransfer = 50\n\tWeightMsgEthCreateContract = 50\n)\n```\n\n## Variables\n\n```go\nvar ErrNoEnoughBalance = fmt.Errorf(\"no enough balance\")\n```\n\n## Functions\n\n```go\nfunc CreateRandomValidEthTx(ctx *simulateContext, from, to *common.Address, amount *big.Int, data *hexutil.Bytes) (ethTx *types.MsgEthereumTx, err error)\n```\nCreateRandomValidEthTx create the ethereum tx with valid random values\n\n```go\nfunc EstimateGas(ctx *simulateContext, from, to *common.Address, data *hexutil.Bytes, gasCap uint64) (gas uint64, err error)\n```\nEstimateGas estimates the gas used by quering the keeper.\n\n```go\nfunc GenEnableCall(r *rand.Rand) bool\n```\nGenEnableCall enables the EnableCall param with 80% probability\n\n```go\nfunc GenEnableCreate(r *rand.Rand) bool\n```\nGenEnableCreate enables the EnableCreate param with 80% probability\n\n```go\nfunc GenExtraEIPs(r *rand.Rand) []int64\n```\nGenExtraEIPs defines a set of extra EIPs with 50% probability\n\n```go\nfunc GetSignedTx(ctx *simulateContext, txBuilder client.TxBuilder, msg *types.MsgEthereumTx, prv cryptotypes.PrivKey) (signedTx signing.Tx, err error)\n```\nGetSignedTx sign the ethereum tx and packs it as a signing.Tx .\n\n```go\nfunc NewDecodeStore() func(kvA, kvB kv.Pair) string\n```\nNewDecodeStore returns a decoder function closure that unmarshals the KVPair's value to the corresponding EVM type.\n\n```go\nfunc ParamChanges(r *rand.Rand) []simtypes.ParamChange\n```\nParamChanges defines the parameters that can be modified by param change proposals on the simulation.\n\n```go\nfunc RandomTransferableAmount(ctx *simulateContext, address common.Address, estimateGas uint64, gasFeeCap *big.Int) (amount *big.Int, err error)\n```\nRandomTransferableAmount generates a random valid transferable amount. Transferable amount is between the range \\[0, spendable), spendable = balance - gasFeeCap \\* GasLimit.\n\n```go\nfunc RandomizedGenState(simState *module.SimulationState)\n```\nRandomizedGenState generates a random GenesisState for the EVM module\n\n```go\nfunc SimulateEthCreateContract(ak types.AccountKeeper, k *keeper.Keeper) simtypes.Operation\n```\nSimulateEthCreateContract simulate create an ERC20 contract. It makes operationSimulateEthCallContract the future operations of SimulateEthCreateContract to ensure valid contract call.\n\n```go\nfunc SimulateEthSimpleTransfer(ak types.AccountKeeper, k *keeper.Keeper) simtypes.Operation\n```\nSimulateEthSimpleTransfer simulate simple eth account transferring gas token. It randomly choose sender, recipient and transferable amount. Other tx details like nonce, gasprice, gaslimit are calculated to get valid value.\n\n```go\nfunc SimulateEthTx(\n\tctx *simulateContext, from, to *common.Address, amount *big.Int, data *hexutil.Bytes, prv cryptotypes.PrivKey, fops []simtypes.FutureOperation,\n) (simtypes.OperationMsg, []simtypes.FutureOperation, error)\n```\nSimulateEthTx creates valid ethereum tx and pack it as cosmos tx, and deliver it.\n\n```go\nfunc WeightedOperations(\n\tappParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, k *keeper.Keeper,\n) simulation.WeightedOperations\n```\nWeightedOperations generate Two kinds of operations: SimulateEthSimpleTransfer, SimulateEthCreateContract. Contract call operations work as the future operations of SimulateEthCreateContract.\n\n","path":"github.com/RAMPAGEXP/ethermint/x/evm/simulation","name":"simulation","synopsis":"","isRedistributable":true}
