testutil

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGenTxGas = 50000000000
)

Variables

View Source
var DefaultConsensusParams = &tmproto.ConsensusParams{
	Block: &tmproto.BlockParams{
		MaxBytes: 200000,
		MaxGas:   -1,
	},
	Evidence: &tmproto.EvidenceParams{
		MaxAgeNumBlocks: 302400,
		MaxAgeDuration:  504 * time.Hour,
		MaxBytes:        10000,
	},
	Validator: &tmproto.ValidatorParams{
		PubKeyTypes: []string{
			tmtypes.ABCIPubKeyTypeEd25519,
		},
	},
}

DefaultConsensusParams defines the default Tendermint consensus params used in StratosApp testing.

Functions

func CheckBalance

func CheckBalance(t *testing.T, app *stratosapp.StratosApp, addr sdk.AccAddress, balances sdk.Coins)

CheckBalance checks the balance of an account.

func MakeTestEncodingConfig

func MakeTestEncodingConfig() simappparams.EncodingConfig

MakeTestEncodingConfig creates an EncodingConfig for testing. This function should be used only in tests or when creating a new app instance (NewApp*()). App user shouldn't create new codecs - use the app.AppCodec instead. [DEPRECATED]

func SetupWithGenesisNodeSet

func SetupWithGenesisNodeSet(t *testing.T,
	valSet *tmtypes.ValidatorSet,
	metaNodes []registertypes.MetaNode,
	resourceNodes []registertypes.ResourceNode,
	genAccs []authtypes.GenesisAccount,
	chainId string,
	freshStart bool,
	balances ...banktypes.Balance) *stratosapp.StratosApp

SetupWithGenesisNodeSet initializes a new SimApp with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit (10^6) in the default token of the simapp from first genesis account. A Nop logger is set in SimApp.

func SignCheckDeliver

func SignCheckDeliver(
	t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg,
	chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error)

SignCheckDeliver checks a generated signed transaction and simulates a block commitment with the given transaction. A test assertion is made using the parameter 'expPass' against the result. A corresponding result is returned.

func SignCheckDeliverWithFee

func SignCheckDeliverWithFee(
	t *testing.T, txCfg client.TxConfig, app *baseapp.BaseApp, header tmproto.Header, msgs []sdk.Msg,
	chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error)

func SignVolumeReport

func SignVolumeReport(volumeReportMsg *pottypes.MsgVolumeReport, privKeys ...[]byte) (*pottypes.MsgVolumeReport, error)

SignVolumeReport Use ed25519 private key of meta nodes to sign

Types

This section is empty.

Jump to

Keyboard shortcuts

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