Documentation ¶
Index ¶
- func AddCrosschainData(t *testing.T, n int, genesisState map[string]json.RawMessage, ...) *types.GenesisState
- func AddObserverData(t *testing.T, n int, genesisState map[string]json.RawMessage, ...) *observertypes.GenesisState
- func ExportGenesisFileWithTimeAndConsensusParams(genFile, chainID string, validators []tmtypes.GenesisValidator, ...) error
- func SetupZetaGenesisState(t *testing.T, genesisState map[string]json.RawMessage, codec codec.Codec, ...)
- type AppConstructor
- type CLILogger
- type Config
- type Logger
- type Network
- type TestFixture
- type TestFixtureFactory
- type Validator
- type ValidatorI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCrosschainData ¶
func AddCrosschainData( t *testing.T, n int, genesisState map[string]json.RawMessage, codec codec.Codec, ) *types.GenesisState
func AddObserverData ¶
func AddObserverData( t *testing.T, n int, genesisState map[string]json.RawMessage, codec codec.Codec, ballots []*observertypes.Ballot, ) *observertypes.GenesisState
func ExportGenesisFileWithTimeAndConsensusParams ¶
func ExportGenesisFileWithTimeAndConsensusParams( genFile, chainID string, validators []tmtypes.GenesisValidator, appState json.RawMessage, genTime time.Time, consensusParams tmtypes.ConsensusParams, ) error
Types ¶
type AppConstructor ¶
type AppConstructor = func(val ValidatorI) servertypes.Application
AppConstructor defines a function which accepts a network configuration and creates an ABCI Application to provide to Tendermint.
type CLILogger ¶
type CLILogger struct {
// contains filtered or unexported fields
}
CLILogger wraps a cobra.Command and provides command logging methods.
func NewCLILogger ¶
NewCLILogger creates a new CLILogger.
type Config ¶
type Config struct { Codec codec.Codec LegacyAmino *codec.LegacyAmino // TODO: Remove! InterfaceRegistry codectypes.InterfaceRegistry TxConfig client.TxConfig AccountRetriever client.AccountRetriever AppConstructor AppConstructor // the ABCI application constructor GenesisState map[string]json.RawMessage // custom genesis state to provide TimeoutCommit time.Duration // the consensus commitment timeout ChainID string // the network chain-id NumValidators int // the total number of validators to create and bond Mnemonics []string // custom user-provided validator operator mnemonics BondDenom string // the staking bond denomination MinGasPrices string // the minimum gas prices each validator will accept AccountTokens math.Int // the amount of unique validator tokens (e.g. 1000node0) StakingTokens math.Int // the amount of tokens each validator has available to stake BondedTokens math.Int // the amount of tokens each validator stakes PruningStrategy string // the pruning strategy each validator will have EnableTMLogging bool // enable Tendermint logging to STDOUT CleanupDir bool // remove base temporary directory during cleanup SigningAlgo string // signing algorithm for keys KeyringOptions []keyring.Option // keyring configuration options RPCAddress string // RPC listen address (including port) APIAddress string // REST API listen address (including port) GRPCAddress string // GRPC server listen address (including port) PrintMnemonic bool // print the mnemonic of first validator as log output for testing }
Config defines the necessary configuration used to bootstrap and start an in-process local testing network.
func DefaultConfig ¶
func DefaultConfig(factory TestFixtureFactory) Config
DefaultConfig returns a sane default configuration suitable for nearly all testing requirements.
type Logger ¶
type Logger interface { Log(args ...interface{}) Logf(format string, args ...interface{}) }
Logger is a network logger interface that exposes testnet-level Log() methods for an in-process testing network This is not to be confused with logging that may happen at an individual node or validator level
type Network ¶
Network defines a local in-process testing network using SimApp. It can be configured to start any number of validators, each with its own RPC and API clients. Typically, this test network would be used in client and integration testing where user input is expected.
Note, due to Tendermint constraints in regards to RPC functionality, there may only be one test network running at a time. Thus, any caller must be sure to Cleanup after testing is finished in order to allow other tests to create networks. In addition, only the first validator will have a valid RPC and API server/client.
func (*Network) Cleanup ¶
func (n *Network) Cleanup()
Cleanup removes the root testing (temporary) directory and stops both the Tendermint and API services. It allows other callers to create and start test networks. This method must be called when a test is finished, typically in a defer.
func (*Network) LatestHeight ¶
LatestHeight returns the latest height of the network or an error if the query fails or no validators exist.
func (*Network) WaitForHeight ¶
WaitForHeight performs a blocking check where it waits for a block to be committed after a given block. If that height is not reached within a timeout, an error is returned. Regardless, the latest height queried is returned.
type TestFixture ¶
type TestFixture struct { AppConstructor AppConstructor GenesisState map[string]json.RawMessage EncodingConfig moduletestutil.TestEncodingConfig }
type TestFixtureFactory ¶
type TestFixtureFactory = func() TestFixture
AppConstructor defines a function which accepts a network configuration and creates an ABCI Application to provide to Tendermint.
type Validator ¶
type Validator struct { AppConfig *srvconfig.Config ClientCtx client.Context Ctx *server.Context Dir string NodeID string PubKey cryptotypes.PubKey Moniker string APIAddress string RPCAddress string P2PAddress string Address sdk.AccAddress ValAddress sdk.ValAddress RPCClient tmclient.Client // contains filtered or unexported fields }
Validator defines an in-process Tendermint validator node. Through this object, a client can make RPC and API calls and interact with any client command or handler.