apptesting

package
v0.0.0-...-aee1c25 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestAppStartingHeight = 1
	TestAppChainID        = "fuelsequencer-1"
	TestAppSidecarEnabled = false
)

Variables

View Source
var (
	TestAppGenesisAccountBalance = math.NewInt(100_000)
	TestAppGenesisStakedAmount   = sdk.DefaultPowerReduction // used by simtestutil.GenesisStateWithValSet
	TestAppGenesisSupply         = TestAppGenesisAccountBalance.Add(TestAppGenesisStakedAmount)
)

Functions

func GetDefaultGenesisStateBytes

func GetDefaultGenesisStateBytes(app *fuelsequencerapp.FuelSequencerApp) []byte

func SetupTestingApp

func SetupTestingApp(isCheckTx bool) *fuelsequencerapp.FuelSequencerApp

SetupTestingApp initializes a new FuelSequencerApp Note: use NewTMLogger(NewSyncWriter(Stdout)) instead of NewNopLogger if you want to see test logs

Types

type KeeperTestHelper

type KeeperTestHelper struct {
	suite.Suite

	App *app.FuelSequencerApp

	QueryHelper *baseapp.QueryServiceTestHelper
	TestAccs    []sdk.AccAddress
}

func (*KeeperTestHelper) AllocateRewardsToValidator

func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt math.Int)

AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address.

func (*KeeperTestHelper) AssertEventEmitted

func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)

AssertEventEmitted asserts that ctx's event manager has emitted the given number of events of the given type.

func (*KeeperTestHelper) AssertEventInEventsList

func (s *KeeperTestHelper) AssertEventInEventsList(
	events []abci.Event,
	eventTypeExpected string,
	numEventsExpected int,
)

AssertEventInEventsList asserts that the events list argument has the given number of events of the given type.

func (*KeeperTestHelper) BeginBlock

func (s *KeeperTestHelper) BeginBlock() (sdk.BeginBlock, error)

BeginBlock runs the app's BeginBlocker.

func (*KeeperTestHelper) BuildTx

func (s *KeeperTestHelper) BuildTx(
	txBuilder client.TxBuilder,
	msgs []sdk.Msg,
	sigV2 signing.SignatureV2,
	memo string, txFee sdk.Coins,
	gasLimit uint64,
) authsigning.Tx

BuildTx builds a transaction.

func (*KeeperTestHelper) CreateTestContext

func (s *KeeperTestHelper) CreateTestContext() sdk.Context

CreateTestContext creates a test context.

func (*KeeperTestHelper) CreateTestContextWithMultiStore

func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, store.CommitMultiStore)

CreateTestContextWithMultiStore creates a test context and returns it together with multi store.

func (*KeeperTestHelper) Ctx

func (s *KeeperTestHelper) Ctx() sdk.Context

Ctx dynamically gets the context of the chain

func (*KeeperTestHelper) EndBlock

func (s *KeeperTestHelper) EndBlock() (sdk.EndBlock, error)

EndBlock runs the app's EndBlocker.

func (*KeeperTestHelper) ExtractAttributes

func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string

func (*KeeperTestHelper) FastForwardBlocks

func (s *KeeperTestHelper) FastForwardBlocks(blocks int) error

FastForwardBlocks is a helper function that increments the chain height

func (*KeeperTestHelper) FindEvent

func (s *KeeperTestHelper) FindEvent(events []sdk.Event, name string) sdk.Event

func (*KeeperTestHelper) FundAcc

func (s *KeeperTestHelper) FundAcc(ctx sdk.Context, acc sdk.AccAddress, amounts sdk.Coins)

FundAcc funds target address with specified amount.

func (*KeeperTestHelper) FundModuleAcc

func (s *KeeperTestHelper) FundModuleAcc(ctx sdk.Context, moduleName string, amounts sdk.Coins)

FundModuleAcc funds target modules with specified amount.

func (*KeeperTestHelper) MintCoins

func (s *KeeperTestHelper) MintCoins(coins sdk.Coins)

func (*KeeperTestHelper) Setup

func (s *KeeperTestHelper) Setup()

Setup sets up basic environment for suite (App, Ctx, and test accounts) with Now() as block time

type MockQueryBlockEventsResponse

type MockQueryBlockEventsResponse struct {
	Response *sidecartypes.QueryBlockEventsResponse
	Error    error
}

type SuitelessAppTestHelper

type SuitelessAppTestHelper struct {
	App *app.FuelSequencerApp
	Ctx sdk.Context
}

Jump to

Keyboard shortcuts

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