Documentation
¶
Index ¶
- Constants
- Variables
- func GetDefaultGenesisStateBytes(app *fuelsequencerapp.FuelSequencerApp) []byte
- func SetupTestingApp(isCheckTx bool) *fuelsequencerapp.FuelSequencerApp
- type KeeperTestHelper
- func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt math.Int)
- func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int)
- func (s *KeeperTestHelper) AssertEventInEventsList(events []abci.Event, eventTypeExpected string, numEventsExpected int)
- func (s *KeeperTestHelper) BeginBlock() (sdk.BeginBlock, error)
- func (s *KeeperTestHelper) BuildTx(txBuilder client.TxBuilder, msgs []sdk.Msg, sigV2 signing.SignatureV2, ...) authsigning.Tx
- func (s *KeeperTestHelper) CreateTestContext() sdk.Context
- func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, store.CommitMultiStore)
- func (s *KeeperTestHelper) Ctx() sdk.Context
- func (s *KeeperTestHelper) EndBlock() (sdk.EndBlock, error)
- func (s *KeeperTestHelper) ExtractAttributes(event sdk.Event) map[string]string
- func (s *KeeperTestHelper) FastForwardBlocks(blocks int) error
- func (s *KeeperTestHelper) FindEvent(events []sdk.Event, name string) sdk.Event
- func (s *KeeperTestHelper) FundAcc(ctx sdk.Context, acc sdk.AccAddress, amounts sdk.Coins)
- func (s *KeeperTestHelper) FundModuleAcc(ctx sdk.Context, moduleName string, amounts sdk.Coins)
- func (s *KeeperTestHelper) MintCoins(coins sdk.Coins)
- func (s *KeeperTestHelper) Setup()
- type MockQueryBlockEventsResponse
- type SuitelessAppTestHelper
Constants ¶
const ( TestAppStartingHeight = 1 TestAppChainID = "fuelsequencer-1" TestAppSidecarEnabled = false )
Variables ¶
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) FundAcc ¶
func (s *KeeperTestHelper) FundAcc(ctx sdk.Context, acc sdk.AccAddress, amounts sdk.Coins)
FundAcc funds target address with specified amount.
func (*KeeperTestHelper) FundModuleAcc ¶
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
}