Back to

Package clitest

Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module:


Package clitest test_helper provides terrad&terracli binary execution for simulation


func WriteToNewTempFile

func WriteToNewTempFile(t *testing.T, s string) *os.File

WriteToNewTempFile writes the given string to a new temporary file

type Fixtures

type Fixtures struct {
	BuildDir       string
	RootDir        string
	TerradBinary   string
	TerracliBinary string
	ChainID        string
	RPCAddr        string
	Port           string
	TerradHome     string
	TerracliHome   string
	P2PAddr        string
	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 terrad add-genesis-account

func (*Fixtures) CLIConfig

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

CLIConfig is terracli 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 terrad 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 terrad 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

GenesisState 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 terracli keys add

func (*Fixtures) KeysAddRecover

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

KeysAddRecover prepares terracli keys add --recover

func (*Fixtures) KeysAddRecoverHDPath

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

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

func (*Fixtures) KeysDelete

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

KeysDelete is terracli keys delete

func (*Fixtures) KeysShow

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

KeysShow is terracli keys show

func (*Fixtures) QueryAccount

func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) authtypes.BaseAccount

QueryAccount is terracli query account

func (*Fixtures) QueryGovDeposit

func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, flags ...string) gov.Deposit

QueryGovDeposit is terracli query gov deposit

func (*Fixtures) QueryGovDeposits

func (f *Fixtures) QueryGovDeposits(propsalID int, flags ...string) []gov.Deposit

QueryGovDeposits is terracli query gov deposits

func (*Fixtures) QueryGovParamDeposit

func (f *Fixtures) QueryGovParamDeposit() gov.DepositParams

QueryGovParamDeposit is terracli query gov param deposit

func (*Fixtures) QueryGovParamTallying

func (f *Fixtures) QueryGovParamTallying() gov.TallyParams

QueryGovParamTallying is terracli query gov param tallying

func (*Fixtures) QueryGovParamVoting

func (f *Fixtures) QueryGovParamVoting() gov.VotingParams

QueryGovParamVoting is terracli query gov param voting

func (*Fixtures) QueryGovProposal

func (f *Fixtures) QueryGovProposal(proposalID int, flags ...string) gov.Proposal

QueryGovProposal is terracli query gov proposal

func (*Fixtures) QueryGovProposals

func (f *Fixtures) QueryGovProposals(flags ...string) gov.Proposals

QueryGovProposals is terracli query gov proposals

func (*Fixtures) QueryGovVote

func (f *Fixtures) QueryGovVote(proposalID int, voter sdk.AccAddress, flags ...string) gov.Vote

QueryGovVote is terracli query gov vote

func (*Fixtures) QueryGovVotes

func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) []gov.Vote

QueryGovVotes is terracli query gov votes

func (*Fixtures) QueryRewards

func (f *Fixtures) QueryRewards(delAddr sdk.AccAddress, flags ...string) distribution.QueryDelegatorTotalRewardsResponse

QueryRewards returns the rewards of a delegator

func (*Fixtures) QuerySigningInfo

func (f *Fixtures) QuerySigningInfo(val string) slashing.ValidatorSigningInfo

QuerySigningInfo returns the signing info for a validator

func (*Fixtures) QuerySlashingParams

func (f *Fixtures) QuerySlashingParams() slashing.Params

QuerySlashingParams is terracli query slashing params

func (*Fixtures) QueryStakingDelegationsTo

func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...string) []staking.Delegation

QueryStakingDelegationsTo is terracli query staking delegations-to

func (*Fixtures) QueryStakingParameters

func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params

QueryStakingParameters is terracli query staking parameters

func (*Fixtures) QueryStakingPool

func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool

QueryStakingPool is terracli query staking pool

func (*Fixtures) QueryStakingUnbondingDelegationsFrom

func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress, flags ...string) []staking.UnbondingDelegation

QueryStakingUnbondingDelegationsFrom is terracli query staking unbonding-delegations-from

func (*Fixtures) QueryStakingValidator

func (f *Fixtures) QueryStakingValidator(valAddr sdk.ValAddress, flags ...string) staking.Validator

QueryStakingValidator is terracli query staking validator

func (*Fixtures) QueryTotalSupply

func (f *Fixtures) QueryTotalSupply(flags ...string) (totalSupply sdk.Coins)

QueryTotalSupply returns the total supply of coins

func (*Fixtures) QueryTotalSupplyOf

func (f *Fixtures) QueryTotalSupplyOf(denom string, flags ...string) sdk.Int

QueryTotalSupplyOf returns the total supply of a given coin denom

func (*Fixtures) QueryTxs

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

QueryTxs is terracli query txs

func (*Fixtures) QueryTxsInvalid

func (f *Fixtures) QueryTxsInvalid(expectedErr error, page, limit int, events ...string)

QueryTxsInvalid query txs with wrong parameters and compare expected error

func (*Fixtures) TDInit

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

TDInit is terrad init NOTE: TDInit sets the ChainID for the Fixtures instance

func (*Fixtures) TDStart

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

TDStart runs terrad start with the appropriate flags and returns a process

func (*Fixtures) TDTendermint

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

TDTendermint returns the results of terrad tendermint [query]

func (*Fixtures) TxBroadcast

func (f *Fixtures) TxBroadcast(fileName string, flags ...string) (bool, string, string)

TxBroadcast is terracli tx broadcast

func (*Fixtures) TxEncode

func (f *Fixtures) TxEncode(fileName string, flags ...string) (bool, string, string)

TxEncode is terracli tx encode

func (*Fixtures) TxEstimateFee

func (f *Fixtures) TxEstimateFee(fileName string, flags ...string) (bool, string, string)

TxEstimateFee is terracli tx estimate-fee

func (*Fixtures) TxGovDeposit

func (f *Fixtures) TxGovDeposit(proposalID int, from string, amount sdk.Coin, flags ...string) (bool, string, string)

TxGovDeposit is terracli tx gov deposit

func (*Fixtures) TxGovSubmitCommunityPoolSpendProposal

func (f *Fixtures) TxGovSubmitCommunityPoolSpendProposal(
	from, proposalPath string, deposit sdk.Coin, flags ...string,
) (bool, string, string)

TxGovSubmitCommunityPoolSpendProposal executes a CLI community pool spend proposal submission.

func (*Fixtures) TxGovSubmitParamChangeProposal

func (f *Fixtures) TxGovSubmitParamChangeProposal(
	from, proposalPath string, deposit sdk.Coin, flags ...string,
) (bool, string, string)

TxGovSubmitParamChangeProposal executes a CLI parameter change proposal submission.

func (*Fixtures) TxGovSubmitProposal

func (f *Fixtures) TxGovSubmitProposal(from, typ, title, description string, deposit sdk.Coin, flags ...string) (bool, string, string)

TxGovSubmitProposal is terracli tx gov submit-proposal

func (*Fixtures) TxGovVote

func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string, flags ...string) (bool, string, string)

TxGovVote is terracli tx gov vote

func (*Fixtures) TxMultisign

func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string,
	flags ...string) (bool, string, string)

TxMultisign is terracli tx multisign

func (*Fixtures) TxSend

func (f *Fixtures) TxSend(from string, to sdk.AccAddress, amount sdk.Coin, flags ...string) (bool, string, string)

TxSend is terracli tx send

func (*Fixtures) TxSign

func (f *Fixtures) TxSign(signer, fileName string, flags ...string) (bool, string, string)

TxSign is terracli tx sign

func (*Fixtures) TxStakingCreateValidator

func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.Coin, flags ...string) (bool, string, string)

TxStakingCreateValidator is terracli tx staking create-validator

func (*Fixtures) TxStakingUnbond

func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) bool

TxStakingUnbond is terracli tx staking unbond

func (*Fixtures) UnsafeResetAll

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

UnsafeResetAll is terrad unsafe-reset-all

func (*Fixtures) ValidateGenesis

func (f *Fixtures) ValidateGenesis()

ValidateGenesis runs terrad validate-genesis

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier