action

package
v2.0.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActionResp

func ActionResp(ctx sdk.Context, respErr error) (outCtx sdk.Context, err error)

Types

type Action

type Action interface {
	// Do is a specific implementation of the `Action`. When `Do` is called,
	// the action is performed and some feedback is provided about the action's
	// success. `Do` can mutate the app.
	//
	// Returns:
	//   - outCtx: The new context after stateful changes
	//   - err: The error if one was raised.
	//   - isMandatory: Whether an error should have been raised.
	Do(app *app.NibiruApp, ctx sdk.Context) (
		outCtx sdk.Context, err error,
	)
}

Action is a type of operation or task that can be performed in the Nibiru application.

func FundAccount

func FundAccount(account sdk.AccAddress, amount sdk.Coins) Action

func FundModule

func FundModule(module string, amount sdk.Coins) Action

func IncreaseBlockNumberBy

func IncreaseBlockNumberBy(numBlocks int64) Action

IncreaseBlockNumberBy increases the block number by the given number of blocks

func IncreaseBlockTimeBy

func IncreaseBlockTimeBy(seconds time.Duration) Action

func MoveToNextBlock

func MoveToNextBlock() Action

func MoveToNextBlockWithDuration

func MoveToNextBlockWithDuration(blockDuration time.Duration) Action

func MoveToNextBlockWithTime

func MoveToNextBlockWithTime(blockTime time.Time) Action

func SetBlockNumber

func SetBlockNumber(blockNumber int64) Action

SetBlockNumber sets the block number to the given value

func SetBlockTime

func SetBlockTime(blockTime time.Time) Action

SetBlockTime sets the block time to the given value

type IsNotMandatory

type IsNotMandatory interface {
	IsNotMandatory()
}

IsNotMandatory is a marker interface for actions that are not mandatory, and it does not stop the test when there is an error.

type TestCase

type TestCase struct {
	Name string
	// contains filtered or unexported fields
}

func TC

func TC(name string) TestCase

TC creates a new test case

func (TestCase) Given

func (tc TestCase) Given(action ...Action) TestCase

func (TestCase) Run

func (tc TestCase) Run(t *testing.T)

func (TestCase) Then

func (tc TestCase) Then(action ...Action) TestCase

func (TestCase) When

func (tc TestCase) When(action ...Action) TestCase

type TestCases

type TestCases []TestCase

type TestSuite

type TestSuite struct {
	// contains filtered or unexported fields
}

func NewTestSuite

func NewTestSuite(t *testing.T) *TestSuite

func (*TestSuite) Run

func (ts *TestSuite) Run()

func (*TestSuite) WithTestCases

func (ts *TestSuite) WithTestCases(testCase ...TestCase) *TestSuite

Jump to

Keyboard shortcuts

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