action

package
v1.2.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 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 added in v1.0.0

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

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, isMandatory bool,
	)
}

`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 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 (t TestCase) Given(action ...Action) TestCase

func (TestCase) Then

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

func (TestCase) When

func (t 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 (t *TestSuite) Run()

func (*TestSuite) WithTestCases

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

Jump to

Keyboard shortcuts

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