testutil

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNodeHome = "/tmp/.liked-test"
View Source
const GenTx = `` /* 1144-byte string literal not displayed */
View Source
const TestChainId = "test-chain-VhVyAD"
View Source
const ValidatorLikeAddr = "like1tf9tg46d82lm32xwq4ms7xj6xse3qu4m5n2h5h"
View Source
const ValidatorLikeValAddr = "likevaloper1tf9tg46d82lm32xwq4ms7xj6xse3qu4mzuufyy"
View Source
const ValidatorMnemonic = "" /* 152-byte string literal not displayed */

Variables

This section is empty.

Functions

func CreateIncrementalAccounts

func CreateIncrementalAccounts(accNum int) []sdk.AccAddress

func GenerateTx

func GenerateTx(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, chainID string, accNums, accSeqs []uint64, feeGranter sdk.AccAddress, priv ...cryptotypes.PrivKey) (sdk.Tx, error)

GenerateTx generates a signed mock transaction.

func GetClassIdFromResult

func GetClassIdFromResult(t *testing.T, result *sdk.Result) string

func GetEventAttribute

func GetEventAttribute(events sdk.Events, typ string, attrKey []byte) []byte

func GetIscnIdFromResult

func GetIscnIdFromResult(t *testing.T, result *sdk.Result) types.IscnId

func TestAddr

func TestAddr(addr string, bech string) (sdk.AccAddress, error)

Types

type GenesisBalance

type GenesisBalance struct {
	Address string
	Coin    string
}

type TestingApp

type TestingApp struct {
	*likeapp.LikeApp

	Header  tmproto.Header
	Context sdk.Context
	// contains filtered or unexported fields
}

func SetupTestApp

func SetupTestApp(genesisBalances []GenesisBalance) *TestingApp

func SetupTestAppWithDefaultState

func SetupTestAppWithDefaultState() *TestingApp

func SetupTestAppWithIscnGenesis

func SetupTestAppWithIscnGenesis(genesisBalances []GenesisBalance, iscnGenesisJson json.RawMessage) *TestingApp

func SetupTestAppWithState

func SetupTestAppWithState(appState json.RawMessage, appOptions servertypes.AppOptions) *TestingApp

func (*TestingApp) DeliverMsg

func (app *TestingApp) DeliverMsg(msg sdk.Msg, priv cryptotypes.PrivKey) (res *sdk.Result, err error, simErr error, deliverErr error)

func (*TestingApp) DeliverMsgNoError

func (app *TestingApp) DeliverMsgNoError(t *testing.T, msg sdk.Msg, priv cryptotypes.PrivKey) *sdk.Result

func (*TestingApp) DeliverMsgSimError

func (app *TestingApp) DeliverMsgSimError(t *testing.T, msg sdk.Msg, priv cryptotypes.PrivKey, errContains string, args ...interface{})

func (*TestingApp) DeliverMsgs

func (app *TestingApp) DeliverMsgs(msgs []sdk.Msg, priv cryptotypes.PrivKey) (res *sdk.Result, err error, simErr error, deliverErr error)

func (*TestingApp) DeliverMsgsNoError

func (app *TestingApp) DeliverMsgsNoError(t *testing.T, msgs []sdk.Msg, priv cryptotypes.PrivKey) *sdk.Result

func (*TestingApp) DeliverMsgsWithFeeGranter

func (app *TestingApp) DeliverMsgsWithFeeGranter(msgs []sdk.Msg, priv cryptotypes.PrivKey, feeGranter sdk.AccAddress) (res *sdk.Result, err error, simErr error, deliverErr error)

func (*TestingApp) NextHeader

func (app *TestingApp) NextHeader(unixTimestamp int64)

func (*TestingApp) SetForQuery

func (app *TestingApp) SetForQuery() sdk.Context

func (*TestingApp) SetForTx

func (app *TestingApp) SetForTx()

Directories

Path Synopsis
Package nullify provides methods to init nil values structs for test assertion.
Package nullify provides methods to init nil values structs for test assertion.

Jump to

Keyboard shortcuts

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