cosmos-sdk: github.com/cosmos/cosmos-sdk/server/mock Index | Files

package mock

import "github.com/cosmos/cosmos-sdk/server/mock"

nolint

Index

Package Files

app.go helpers.go store.go tx.go

func AppGenState Uses

func AppGenState(_ *codec.LegacyAmino, _ types.GenesisDoc, _ []json.RawMessage) (appState json.
    RawMessage, err error)

AppGenState can be passed into InitCmd, returns a static string of a few key-values that can be parsed by InitChainer

func AppGenStateEmpty Uses

func AppGenStateEmpty(_ *codec.LegacyAmino, _ types.GenesisDoc, _ []json.RawMessage) (
    appState json.RawMessage, err error)

AppGenStateEmpty returns an empty transaction state for mocking.

func InitChainer Uses

func InitChainer(key sdk.StoreKey) func(sdk.Context, abci.RequestInitChain) abci.ResponseInitChain

InitChainer returns a function that can initialize the chain with key/value pairs

func KVStoreHandler Uses

func KVStoreHandler(storeKey sdk.StoreKey) sdk.Handler

KVStoreHandler is a simple handler that takes kvstoreTx and writes them to the db

func NewApp Uses

func NewApp(rootDir string, logger log.Logger) (abci.Application, error)

NewApp creates a simple mock kvstore app for testing. It should work similar to a real app. Make sure rootDir is empty before running the test, in order to guarantee consistent results

func NewCommitMultiStore Uses

func NewCommitMultiStore() sdk.CommitMultiStore

func NewTx Uses

func NewTx(key, value string) kvstoreTx

func SetupApp Uses

func SetupApp() (abci.Application, func(), error)

SetupApp returns an application as well as a clean-up function to be used to quickly setup a test case with an app

type GenesisJSON Uses

type GenesisJSON struct {
    Values []KV `json:"values"`
}

What Genesis JSON is formatted as

type KV Uses

type KV struct {
    Key   string `json:"key"`
    Value string `json:"value"`
}

basic KV structure

Package mock imports 17 packages (graph). Updated 2020-08-13. Refresh now. Tools for package owners.