cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Denom        = "stake"
	KeyFoo       = "foo"
	KeyBar       = "bar"
	FooDenom     = "footoken"
	FeeDenom     = "feetoken"
	Fee2Denom    = "fee2token"
	KeyBaz       = "baz"
	KeyVesting   = "vesting"
	KeyFooBarBaz = "foobarbaz"
)

Variables

Functions

func AddFlags

func AddFlags(cmd string, flags []string) string

func ExecuteWrite

func ExecuteWrite(t *testing.T, cmdStr string, writes ...string) (exitSuccess bool)

func ExecuteWriteCheckErr

func ExecuteWriteCheckErr(t *testing.T, cmdStr string, writes ...string)

func ExecuteWriteRetStdStreams

func ExecuteWriteRetStdStreams(t *testing.T, cmdStr string, writes ...string) (bool, string, string)

func MarshalStdTx

func MarshalStdTx(t require.TestingT, c *codec.Codec, stdTx auth.StdTx) []byte

func UnmarshalStdTx

func UnmarshalStdTx(t require.TestingT, c *codec.Codec, s string) (stdTx auth.StdTx)

Types

type Fixtures

type Fixtures struct {
	BuildDir     string
	RootDir      string
	SimdBinary   string
	SimcliBinary string
	ChainID      string
	RPCAddr      string
	Port         string
	SimdHome     string
	SimcliHome   string
	P2PAddr      string
	Cdc          *codec.Codec
	T            *testing.T
}

Fixtures is used to setup the testing environment

func InitFixtures

func InitFixtures(t *testing.T) (f *Fixtures)

InitFixtures is called at the beginning of a test and initializes a chain with 1 validator.

func NewFixtures

func NewFixtures(t *testing.T) *Fixtures

NewFixtures creates a new instance of Fixtures with many vars set

func (*Fixtures) AddGenesisAccount

func (f *Fixtures) AddGenesisAccount(address sdk.AccAddress, coins sdk.Coins, flags ...string)

AddGenesisAccount is simd add-genesis-account

func (*Fixtures) CLIConfig

func (f *Fixtures) CLIConfig(key, value string, flags ...string)

CLIConfig is simcli config

func (*Fixtures) Cleanup

func (f *Fixtures) Cleanup(dirs ...string)

Cleanup is meant to be run at the end of a test to clean up an remaining test state

func (*Fixtures) CollectGenTxs

func (f *Fixtures) CollectGenTxs(flags ...string)

CollectGenTxs is simd collect-gentxs

func (*Fixtures) Flags

func (f *Fixtures) Flags() string

Flags returns the flags necessary for making most CLI calls

func (*Fixtures) GenTx

func (f *Fixtures) GenTx(name string, flags ...string)

GenTx is simd gentx

func (Fixtures) GenesisFile

func (f Fixtures) GenesisFile() string

GenesisFile returns the path of the genesis file

func (Fixtures) GenesisState

func (f Fixtures) GenesisState() simapp.GenesisState

GenesisFile returns the application's genesis state

func (*Fixtures) KeyAddress

func (f *Fixtures) KeyAddress(name string) sdk.AccAddress

KeyAddress returns the SDK account address from the key

func (*Fixtures) KeysAdd

func (f *Fixtures) KeysAdd(name string, flags ...string)

KeysAdd is simcli keys add

func (*Fixtures) KeysAddRecover

func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (exitSuccess bool, stdout, stderr string)

KeysAddRecover prepares simcli keys add --recover

func (*Fixtures) KeysAddRecoverHDPath

func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string)

KeysAddRecoverHDPath prepares simcli keys add --recover --account --index

func (*Fixtures) KeysDelete

func (f *Fixtures) KeysDelete(name string, flags ...string)

KeysDelete is simcli keys delete

func (*Fixtures) KeysShow

func (f *Fixtures) KeysShow(name string, flags ...string) keyring.KeyOutput

KeysShow is simcli keys show

func (*Fixtures) QueryTxs

func (f *Fixtures) QueryTxs(page, limit int, events ...string) *sdk.SearchTxsResult

QueryTxs is simcli query txs

func (*Fixtures) SDInit

func (f *Fixtures) SDInit(moniker string, flags ...string)

SDInit is simd init NOTE: SDInit sets the ChainID for the Fixtures instance

func (*Fixtures) SDStart

func (f *Fixtures) SDStart(flags ...string) *tests.Process

SDStart runs simd start with the appropriate flags and returns a process

func (*Fixtures) SDTendermint

func (f *Fixtures) SDTendermint(query string) string

SDTendermint returns the results of simd tendermint [query]

func (*Fixtures) UnsafeResetAll

func (f *Fixtures) UnsafeResetAll(flags ...string)

UnsafeResetAll is simd unsafe-reset-all

func (*Fixtures) ValidateGenesis

func (f *Fixtures) ValidateGenesis()

ValidateGenesis runs simd validate-genesis

Jump to

Keyboard shortcuts

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