testapp

package
v0.0.0-...-81c3603 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const QueryPath = "/testapp.v1.GetService/Get"

Variables

This section is empty.

Functions

func MakeGenesisAppState

func MakeGenesisAppState(t *testing.T, app *App, kvs ...string) map[string]json.RawMessage

func ToTx

func ToTx(t *testing.T, k, v string) []byte

func ToTxs

func ToTxs(t *testing.T, kvs map[string]string) [][]byte

ToTxs converts the key-values to SetRequest sdk.Msgs and marshals the messages to protobuf wire format. Each message is placed in a separate tx.

Types

type App

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

App is an app with the absolute minimum amount of configuration required to have the Monomer rollup module. It also has a dummy test module for easy transaction testing. The test module will initialize a single validator to satisfy the module manager's InitChain invariant that the validator set must be non-empty (the requirement doesn't make sense to me since that's a consensus-layer concern).

func New

func New(appdb dbm.DB, chainID string) (*App, error)

func NewTest

func NewTest(t *testing.T, chainID string) *App

func (*App) CheckTx

func (*App) Commit

func (*App) DefaultGenesis

func (a *App) DefaultGenesis() map[string]json.RawMessage

DefaultGenesis returns the app's default genesis state. It must be cloned before it is modified.

func (*App) Info

func (*App) Query

func (*App) RollbackToHeight

func (a *App) RollbackToHeight(_ context.Context, targetHeight uint64) error

func (*App) StateContains

func (a *App) StateContains(t *testing.T, height uint64, kvs map[string]string)

StateContains ensures the key-values exist in the testmodule's state.

func (*App) StateDoesNotContain

func (a *App) StateDoesNotContain(t *testing.T, height uint64, kvs map[string]string)

StateDoesNotContain ensures the key-values do not exist in the app's state.

Directories

Path Synopsis
x

Jump to

Keyboard shortcuts

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