Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRandomValidEthTx(ctx *simulateContext, from, to *common.Address, amount *big.Int, ...) (ethTx *types.MsgEthereumTx, err error)
- func EstimateGas(ctx *simulateContext, from, to *common.Address, data *hexutil.Bytes, ...) (gas uint64, err error)
- func GenEnableCall(r *rand.Rand) bool
- func GenEnableCreate(r *rand.Rand) bool
- func GenExtraEIPs(r *rand.Rand) []int64
- func GetSignedTx(ctx *simulateContext, txBuilder client.TxBuilder, msg *types.MsgEthereumTx, ...) (signedTx signing.Tx, err error)
- func NewDecodeStore() func(kvA, kvB kv.Pair) string
- func ParamChanges(r *rand.Rand) []simtypes.ParamChange
- func RandomTransferableAmount(ctx *simulateContext, address common.Address, estimateGas uint64, ...) (amount *big.Int, err error)
- func RandomizedGenState(simState *module.SimulationState)
- func SimulateEthCreateContract(ak types.AccountKeeper, k *keeper.Keeper) simtypes.Operation
- func SimulateEthSimpleTransfer(ak types.AccountKeeper, k *keeper.Keeper) simtypes.Operation
- func SimulateEthTx(ctx *simulateContext, from, to *common.Address, amount *big.Int, ...) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
- func WeightedOperations(appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, ...) simulation.WeightedOperations
Constants ¶
const ( /* #nosec */ OpWeightMsgEthSimpleTransfer = "op_weight_msg_eth_simple_transfer" /* #nosec */ OpWeightMsgEthCreateContract = "op_weight_msg_eth_create_contract" /* #nosec */ OpWeightMsgEthCallContract = "op_weight_msg_eth_call_contract" )
const ( WeightMsgEthSimpleTransfer = 50 WeightMsgEthCreateContract = 50 )
Variables ¶
var ErrNoEnoughBalance = fmt.Errorf("no enough balance")
Functions ¶
func CreateRandomValidEthTx ¶ added in v0.16.1
func CreateRandomValidEthTx(ctx *simulateContext, from, to *common.Address, amount *big.Int, data *hexutil.Bytes) (ethTx *types.MsgEthereumTx, err error)
CreateRandomValidEthTx create the ethereum tx with valid random values
func EstimateGas ¶ added in v0.16.1
func EstimateGas(ctx *simulateContext, from, to *common.Address, data *hexutil.Bytes, gasCap uint64) (gas uint64, err error)
EstimateGas estimates the gas used by quering the keeper.
func GenEnableCall ¶ added in v0.16.1
GenEnableCall enables the EnableCall param with 80% probability
func GenEnableCreate ¶ added in v0.16.1
GenEnableCreate enables the EnableCreate param with 80% probability
func GenExtraEIPs ¶ added in v0.16.1
GenExtraEIPs defines a set of extra EIPs with 50% probability
func GetSignedTx ¶ added in v0.16.1
func GetSignedTx(ctx *simulateContext, txBuilder client.TxBuilder, msg *types.MsgEthereumTx, prv cryptotypes.PrivKey) (signedTx signing.Tx, err error)
GetSignedTx sign the ethereum tx and packs it as a signing.Tx .
func NewDecodeStore ¶ added in v0.16.1
NewDecodeStore returns a decoder function closure that unmarshals the KVPair's value to the corresponding EVM type.
func ParamChanges ¶ added in v0.16.1
func ParamChanges(r *rand.Rand) []simtypes.ParamChange
ParamChanges defines the parameters that can be modified by param change proposals on the simulation.
func RandomTransferableAmount ¶ added in v0.16.1
func RandomTransferableAmount(ctx *simulateContext, address common.Address, estimateGas uint64, gasFeeCap *big.Int) (amount *big.Int, err error)
RandomTransferableAmount generates a random valid transferable amount. Transferable amount is between the range [0, spendable), spendable = balance - gasFeeCap * GasLimit.
func RandomizedGenState ¶
func RandomizedGenState(simState *module.SimulationState)
RandomizedGenState generates a random GenesisState for the EVM module
func SimulateEthCreateContract ¶ added in v0.16.1
SimulateEthCreateContract simulate create an ERC20 contract. It makes operationSimulateEthCallContract the future operations of SimulateEthCreateContract to ensure valid contract call.
func SimulateEthSimpleTransfer ¶ added in v0.16.1
SimulateEthSimpleTransfer 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.
func SimulateEthTx ¶ added in v0.16.1
func SimulateEthTx( ctx *simulateContext, from, to *common.Address, amount *big.Int, data *hexutil.Bytes, prv cryptotypes.PrivKey, fops []simtypes.FutureOperation, ) (simtypes.OperationMsg, []simtypes.FutureOperation, error)
SimulateEthTx creates valid ethereum tx and pack it as cosmos tx, and deliver it.
func WeightedOperations ¶ added in v0.16.1
func WeightedOperations( appParams simtypes.AppParams, cdc codec.JSONCodec, ak types.AccountKeeper, k *keeper.Keeper, ) simulation.WeightedOperations
WeightedOperations generate Two kinds of operations: SimulateEthSimpleTransfer, SimulateEthCreateContract. Contract call operations work as the future operations of SimulateEthCreateContract.
Types ¶
This section is empty.