utils

package
v0.0.38 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareStores

func CompareStores(t *testing.T, storeKey sdk.StoreKey, expected store.KVStore, actual store.KVStore, testName string)

func Funds

func Funds(amount int64) sdk.Coins

func RunWithOCC

func RunWithOCC(testCtx *TestContext, msgs []*TestMessage) ([]types.Event, []*types.ExecTxResult, types.ResponseEndBlock, error)

RunWithOCC runs the given messages with OCC enabled, number of workers is configured via context

func RunWithoutOCC

func RunWithoutOCC(testCtx *TestContext, msgs []*TestMessage) ([]types.Event, []*types.ExecTxResult, types.ResponseEndBlock, error)

RunWithoutOCC runs the given messages without OCC enabled

Types

type TestAcct

type TestAcct struct {
	ValidatorAddress sdk.ValAddress
	AccountAddress   sdk.AccAddress
	PrivateKey       cryptotypes.PrivKey
	PublicKey        cryptotypes.PubKey
	EvmAddress       common.Address
	EvmSigner        ethtypes.Signer
	EvmPrivateKey    *ecdsa.PrivateKey
}

func NewSigner

func NewSigner() TestAcct

func NewTestAccounts

func NewTestAccounts(count int) []TestAcct

type TestContext

type TestContext struct {
	Ctx            sdk.Context
	CodeID         uint64
	Validator      TestAcct
	TestAccounts   []TestAcct
	ContractKeeper *wasmkeeper.PermissionedKeeper
	TestApp        *app.App
}

func NewTestContext

func NewTestContext(t *testing.T, testAccts []TestAcct, blockTime time.Time, workers int, occEnabled bool) *TestContext

NewTestContext initializes a new TestContext with a new app and a new contract

type TestMessage

type TestMessage struct {
	Msg       sdk.Msg
	Type      string
	EVMSigner TestAcct
	IsEVM     bool
}

func JoinMsgs

func JoinMsgs(msgsList ...[]*TestMessage) []*TestMessage

func Shuffle

func Shuffle(msgs []*TestMessage) []*TestMessage

Jump to

Keyboard shortcuts

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