testutil

package
v1.0.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2025 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ExampleMinGasPrices defines 20B related to atto units as the minimum gas price value on the fee market module.
	// See https://commonwealth.im/evmos/discussion/5073-global-min-gas-price-value-for-cosmos-sdk-and-evm-transaction-choosing-a-value for reference
	ExampleMinGasPrices = math.LegacyNewDec(20_000_000_000)

	// ExampleMinGasMultiplier defines the min gas multiplier value on the fee market module.
	// 50% of the leftover gas will be refunded
	ExampleMinGasMultiplier = math.LegacyNewDecWithPrec(5, 1)
)

Functions

func CreateNestedMsgExec added in v0.4.0

func CreateNestedMsgExec(a sdk.AccAddress, nestedLvl int, lastLvlMsgs []sdk.Msg) *authz.MsgExec

func CreateTx added in v0.4.0

func CreateTx(ctx context.Context, txCfg client.TxConfig, priv cryptotypes.PrivKey, msgs ...sdk.Msg) (sdk.Tx, error)

func FundAccount

func FundAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amounts sdk.Coins) error

FundAccount is a utility function that funds an account by minting and sending the coins to the address.

func FundAccountWithBaseDenom

func FundAccountWithBaseDenom(ctx sdk.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amount int64) error

FundAccountWithBaseDenom is a utility function that uses the FundAccount function to fund an account with the default Cosmos EVM denomination.

func FundModuleAccount

func FundModuleAccount(ctx sdk.Context, bankKeeper bankkeeper.Keeper, recipientMod string, amounts sdk.Coins) error

FundModuleAccount is a utility function that funds a module account by minting and sending the coins to the address.

func GeneratePrivKeyAddressPairs added in v0.3.0

func GeneratePrivKeyAddressPairs(accCount int) ([]*ethsecp256k1.PrivKey, []sdk.AccAddress, error)

func GetVoucherDenomFromPacketData added in v0.2.0

func GetVoucherDenomFromPacketData(
	data transfertypes.InternalTransferRepresentation,
	destPort string,
	destChannel string,
) string

func NewHeader

func NewHeader(
	height int64,
	blockTime time.Time,
	chainID string,
	proposer sdk.ConsAddress,
	appHash,
	validatorHash []byte,
) tmproto.Header

NewHeader creates a new Tendermint header for testing purposes.

func NewMsgExec added in v0.4.0

func NewMsgExec(grantee sdk.AccAddress, msgs []sdk.Msg) *authz.MsgExec

func NewMsgGrant added in v0.4.0

func NewMsgGrant(granter sdk.AccAddress, grantee sdk.AccAddress, a authz.Authorization, expiration *time.Time) *authz.MsgGrant

func NewStateDB

func NewStateDB(ctx sdk.Context, evmKeeper anteinterfaces.EVMKeeper) *statedb.StateDB

NewStateDB returns a new StateDB for testing purposes.

func NoOpNextFn

func NoOpNextFn(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error)

NoOpNextFn is a no-op function that returns the context and no error in order to mock the next function in the AnteHandler chain.

It can be used in unit tests when calling a decorator's AnteHandle method, e.g. `dec.AnteHandle(ctx, tx, false, NoOpNextFn)`

Types

This section is empty.

Directories

Path Synopsis
This file contains the variables, constants, and default values used in the testing package and commonly defined in tests.
This file contains the variables, constants, and default values used in the testing package and commonly defined in tests.
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL