Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalTx(t *testing.T, stdTx tx.Tx) []byte
- func UnmarshalTx(t *testing.T, s []byte) (stdTx tx.Tx)
- func UnmarshalTxResponse(t *testing.T, s []byte) (txResp sdk.TxResponse)
- func WaitForStart(url string)
- func WaitForTMStart(port string)
- func WriteToNewTempFile(t *testing.T, s string) *os.File
- type FixtureGroup
- type Fixtures
- func (f *Fixtures) AddGenesisAccount(address sdk.AccAddress, coins sdk.Coins, flags ...string)
- func (f *Fixtures) Cleanup(dirs ...string)
- func (f Fixtures) Clone() *Fixtures
- func (f *Fixtures) CollectGenTxs(flags ...string)
- func (f *Fixtures) GenTx(name string, flags ...string)
- func (f Fixtures) GenesisFile() string
- func (f Fixtures) GenesisState() app.GenesisState
- func (f *Fixtures) KeyAddress(name string) sdk.AccAddress
- func (f *Fixtures) KeysAdd(name string, flags ...string)
- func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string)
- func (f *Fixtures) KeysDelete(name string, flags ...string)
- func (f *Fixtures) KeysShow(name string, flags ...string) keyring.KeyOutput
- func (f *Fixtures) LFBInit(moniker string, flags ...string)
- func (f *Fixtures) LFBOstracon(query string) string
- func (f *Fixtures) LFBStart(minGasPrices string) *testnet.Network
- func (f *Fixtures) LogResult(isSuccess bool, stdOut, stdErr string)
- func (f *Fixtures) MempoolNumUnconfirmedTxs(flags ...string) *ostctypes.ResultUnconfirmedTxs
- func (f *Fixtures) NetInfo(flags ...string) *ostctypes.ResultNetInfo
- func (f Fixtures) PrivValidatorKeyFile() string
- func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) authtypes.BaseAccount
- func (f *Fixtures) QueryBalances(address sdk.AccAddress, flags ...string) banktypes.QueryAllBalancesResponse
- func (f *Fixtures) QueryBlockWithHeight(height int, flags ...string) *ostctypes.ResultBlock
- func (f *Fixtures) QueryCodeWasm(codeID uint64, outputPath string, flags ...string)
- func (f *Fixtures) QueryContractStateSmartWasm(contractAddress string, reqJSON string, flags ...string) string
- func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, flags ...string) gov.Deposit
- func (f *Fixtures) QueryGovDeposits(propsalID int, flags ...string) gov.QueryDepositsResponse
- func (f *Fixtures) QueryGovParamDeposit(flags ...string) gov.DepositParams
- func (f *Fixtures) QueryGovParamTallying(flags ...string) gov.TallyParams
- func (f *Fixtures) QueryGovParamVoting(flags ...string) gov.VotingParams
- func (f *Fixtures) QueryGovProposal(proposalID int, flags ...string) gov.Proposal
- func (f *Fixtures) QueryGovProposals(flags ...string) gov.QueryProposalsResponse
- func (f *Fixtures) QueryGovVote(proposalID int, voter sdk.AccAddress, flags ...string) gov.Vote
- func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) gov.QueryVotesResponse
- func (f *Fixtures) QueryLatestBlock(flags ...string) *ostctypes.ResultBlock
- func (f *Fixtures) QueryListCodeWasm(flags ...string) wasmtypes.QueryCodesResponse
- func (f *Fixtures) QueryListContractByCodeWasm(codeID uint64, flags ...string) wasmtypes.QueryContractsByCodeResponse
- func (f *Fixtures) QueryRewards(delAddr sdk.AccAddress, flags ...string) disttypes.QueryDelegatorTotalRewardsResponse
- func (f *Fixtures) QuerySigningInfo(val string, flags ...string) slashing.ValidatorSigningInfo
- func (f *Fixtures) QuerySlashingParams(flags ...string) slashing.Params
- func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...string) staking.QueryValidatorDelegationsResponse
- func (f *Fixtures) QueryStakingParameters(flags ...string) staking.Params
- func (f *Fixtures) QueryStakingPool(flags ...string) staking.Pool
- func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress, flags ...string) staking.QueryValidatorUnbondingDelegationsResponse
- func (f *Fixtures) QueryStakingValidator(valAddr sdk.ValAddress, flags ...string) staking.Validator
- func (f *Fixtures) QueryTotalSupply(flags ...string) (totalSupply banktypes.QueryTotalSupplyResponse)
- func (f *Fixtures) QueryTotalSupplyOf(denom string, flags ...string) sdk.Coin
- func (f *Fixtures) QueryTx(hash string, flags ...string) *sdk.TxResponse
- func (f *Fixtures) QueryTxInvalid(expectedErr error, hash string, flags ...string)
- func (f *Fixtures) QueryTxs(page, limit int, flags ...string) *sdk.SearchTxsResult
- func (f *Fixtures) QueryTxsInvalid(expectedErr error, page, limit int, flags ...string)
- func (f *Fixtures) Status() *ostctypes.ResultStatus
- func (f *Fixtures) TxBroadcast(fileName string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxEncode(fileName string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxExecuteWasm(contractAddress string, msgJSON string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxGovDeposit(proposalID int, from string, amount sdk.Coin, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxGovSubmitCommunityPoolSpendProposal(from, proposalPath string, deposit sdk.Coin, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxGovSubmitParamChangeProposal(from, proposalPath string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxGovSubmitProposal(from, typ, title, description string, deposit sdk.Coin, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxInstantiateWasm(codeID uint64, msgJSON string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxSend(from string, to sdk.AccAddress, amount sdk.Coin, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxSign(signer, fileName string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.Coin, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) TxStoreWasm(wasmFilePath string, flags ...string) (testutil.BufferWriter, error)
- func (f *Fixtures) UnsafeResetAll(flags ...string)
- func (f *Fixtures) ValidateGenesis(genFile string, flags ...string)
Constants ¶
const ( DenomStake = "stake2" DenomLink = "link" UserTina = "tina" UserKevin = "kevin" UserRinah = "rinah" UserBrian = "brian" UserEvelyn = "evelyn" UserSam = "sam" )
Variables ¶
var ( TotalCoins = sdk.NewCoins( sdk.NewCoin(DenomLink, sdk.TokensFromConsensusPower(6000)), sdk.NewCoin(DenomStake, sdk.TokensFromConsensusPower(600000000)), sdk.NewCoin(fee2Denom, sdk.TokensFromConsensusPower(2000000)), sdk.NewCoin(feeDenom, sdk.TokensFromConsensusPower(2000000)), sdk.NewCoin(fooDenom, sdk.TokensFromConsensusPower(2000)), sdk.NewCoin(denom, sdk.TokensFromConsensusPower(300)), ) )
Functions ¶
func UnmarshalTxResponse ¶
func UnmarshalTxResponse(t *testing.T, s []byte) (txResp sdk.TxResponse)
func WaitForStart ¶
func WaitForStart(url string)
WaitForStart waits for the node to start by pinging the url every 100ms for 10s until it returns 200. If it takes longer than 5s, it panics.
func WaitForTMStart ¶
func WaitForTMStart(port string)
wait for tendermint to start by querying tendermint
Types ¶
type FixtureGroup ¶
type FixtureGroup struct { T *testing.T Network *testnet.Network BaseDir string // contains filtered or unexported fields }
func InitFixturesGroup ¶
func InitFixturesGroup(t *testing.T, numOfNodes ...int) *FixtureGroup
func NewFixtureGroup ¶
func NewFixtureGroup(t *testing.T) *FixtureGroup
func (*FixtureGroup) AddFullNode ¶
func (fg *FixtureGroup) AddFullNode(flags ...string) *Fixtures
func (*FixtureGroup) Cleanup ¶
func (fg *FixtureGroup) Cleanup()
func (*FixtureGroup) Fixture ¶
func (fg *FixtureGroup) Fixture(index int) *Fixtures
func (*FixtureGroup) LFBStartCluster ¶
func (fg *FixtureGroup) LFBStartCluster(flags ...string)
type Fixtures ¶
type Fixtures struct { ChainID string RPCAddr string Port string Home string P2PAddr string P2PPort string GRPCAddr string GRPCPort string TMAddr string TMPort string Moniker string T *testing.T }
Fixtures is used to setup the testing environment
func InitFixtures ¶
InitFixtures is called at the beginning of a test and initializes a chain with 1 validator.
func NewFixtures ¶
NewFixtures creates a new instance of Fixtures with many vars set
func (*Fixtures) AddGenesisAccount ¶
AddGenesisAccount is lfb add-genesis-account
func (*Fixtures) Cleanup ¶
Cleanup is meant to be run at the end of a test to clean up an remaining test state
func (*Fixtures) CollectGenTxs ¶
CollectGenTxs is lfb collect-gentxs
func (Fixtures) GenesisFile ¶
GenesisFile returns the path of the genesis file
func (Fixtures) GenesisState ¶
func (f Fixtures) GenesisState() app.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) KeysAddRecover ¶
func (f *Fixtures) KeysAddRecover(name, mnemonic string, flags ...string) (testutil.BufferWriter, error)
KeysAddRecover prepares lfb keys add --recover
func (*Fixtures) KeysAddRecoverHDPath ¶
func (f *Fixtures) KeysAddRecoverHDPath(name, mnemonic string, account uint32, index uint32, flags ...string)
KeysAddRecoverHDPath prepares lfb keys add --recover --account --index
func (*Fixtures) KeysDelete ¶
KeysDelete is lfb keys delete
func (*Fixtures) LFBInit ¶
LFBInit is lfb init NOTE: LFBInit sets the ChainID for the Fixtures instance
func (*Fixtures) LFBOstracon ¶
LFBOstracon returns the results of lfb ostracon [query]
func (*Fixtures) MempoolNumUnconfirmedTxs ¶
func (f *Fixtures) MempoolNumUnconfirmedTxs(flags ...string) *ostctypes.ResultUnconfirmedTxs
MempoolNumUnconfirmedTxs is linkcli mempool num-unconfirmed-txs
func (*Fixtures) NetInfo ¶
func (f *Fixtures) NetInfo(flags ...string) *ostctypes.ResultNetInfo
___________________________________________________________________________________ tendermint rpc
func (Fixtures) PrivValidatorKeyFile ¶
func (*Fixtures) QueryAccount ¶
func (f *Fixtures) QueryAccount(address sdk.AccAddress, flags ...string) authtypes.BaseAccount
QueryAccount is lfb query account
func (*Fixtures) QueryBalances ¶
func (f *Fixtures) QueryBalances(address sdk.AccAddress, flags ...string) banktypes.QueryAllBalancesResponse
QueryBalances is lfb query bank balances
func (*Fixtures) QueryBlockWithHeight ¶
func (f *Fixtures) QueryBlockWithHeight(height int, flags ...string) *ostctypes.ResultBlock
func (*Fixtures) QueryCodeWasm ¶
func (*Fixtures) QueryContractStateSmartWasm ¶
func (*Fixtures) QueryGovDeposit ¶
func (f *Fixtures) QueryGovDeposit(proposalID int, depositor sdk.AccAddress, flags ...string) gov.Deposit
QueryGovDeposit is lfb query gov deposit
func (*Fixtures) QueryGovDeposits ¶
func (f *Fixtures) QueryGovDeposits(propsalID int, flags ...string) gov.QueryDepositsResponse
QueryGovDeposits is lfb query gov deposits
func (*Fixtures) QueryGovParamDeposit ¶
func (f *Fixtures) QueryGovParamDeposit(flags ...string) gov.DepositParams
QueryGovParamDeposit is lfb query gov param deposit
func (*Fixtures) QueryGovParamTallying ¶
func (f *Fixtures) QueryGovParamTallying(flags ...string) gov.TallyParams
QueryGovParamTallying is lfb query gov param tallying
func (*Fixtures) QueryGovParamVoting ¶
func (f *Fixtures) QueryGovParamVoting(flags ...string) gov.VotingParams
QueryGovParamVoting is lfb query gov param voting
func (*Fixtures) QueryGovProposal ¶
QueryGovProposal is lfb query gov proposal
func (*Fixtures) QueryGovProposals ¶
func (f *Fixtures) QueryGovProposals(flags ...string) gov.QueryProposalsResponse
QueryGovProposals is lfb query gov proposals
func (*Fixtures) QueryGovVote ¶
QueryGovVote is lfb query gov vote
func (*Fixtures) QueryGovVotes ¶
func (f *Fixtures) QueryGovVotes(proposalID int, flags ...string) gov.QueryVotesResponse
QueryGovVotes is lfb query gov votes
func (*Fixtures) QueryLatestBlock ¶
func (f *Fixtures) QueryLatestBlock(flags ...string) *ostctypes.ResultBlock
func (*Fixtures) QueryListCodeWasm ¶
func (f *Fixtures) QueryListCodeWasm(flags ...string) wasmtypes.QueryCodesResponse
func (*Fixtures) QueryListContractByCodeWasm ¶
func (f *Fixtures) QueryListContractByCodeWasm(codeID uint64, flags ...string) wasmtypes.QueryContractsByCodeResponse
func (*Fixtures) QueryRewards ¶
func (f *Fixtures) QueryRewards(delAddr sdk.AccAddress, flags ...string) disttypes.QueryDelegatorTotalRewardsResponse
QueryRewards returns the rewards of a delegator
func (*Fixtures) QuerySigningInfo ¶
func (f *Fixtures) QuerySigningInfo(val string, flags ...string) slashing.ValidatorSigningInfo
QuerySigningInfo returns the signing info for a validator
func (*Fixtures) QuerySlashingParams ¶
QuerySlashingParams is lfb query slashing params
func (*Fixtures) QueryStakingDelegationsTo ¶
func (f *Fixtures) QueryStakingDelegationsTo(valAddr sdk.ValAddress, flags ...string) staking.QueryValidatorDelegationsResponse
QueryStakingDelegationsTo is lfb query staking delegations-to
func (*Fixtures) QueryStakingParameters ¶
QueryStakingParameters is lfb query staking parameters
func (*Fixtures) QueryStakingPool ¶
QueryStakingPool is lfb query staking pool
func (*Fixtures) QueryStakingUnbondingDelegationsFrom ¶
func (f *Fixtures) QueryStakingUnbondingDelegationsFrom(valAddr sdk.ValAddress, flags ...string) staking.QueryValidatorUnbondingDelegationsResponse
QueryStakingUnbondingDelegationsFrom is lfb query staking unbonding-delegations-from
func (*Fixtures) QueryStakingValidator ¶
QueryStakingValidator is lfb query staking validator
func (*Fixtures) QueryTotalSupply ¶
func (f *Fixtures) QueryTotalSupply(flags ...string) (totalSupply banktypes.QueryTotalSupplyResponse)
QueryTotalSupply returns the total supply of coins
func (*Fixtures) QueryTotalSupplyOf ¶
QueryTotalSupplyOf returns the total supply of a given coin denom
func (*Fixtures) QueryTx ¶
func (f *Fixtures) QueryTx(hash string, flags ...string) *sdk.TxResponse
QueryTx is lfb query tx
func (*Fixtures) QueryTxInvalid ¶
QueryTxInvalid query tx with wrong hash and compare expected error
func (*Fixtures) QueryTxs ¶
func (f *Fixtures) QueryTxs(page, limit int, flags ...string) *sdk.SearchTxsResult
QueryTxs is lfb query txs
func (*Fixtures) QueryTxsInvalid ¶
QueryTxsInvalid query txs with wrong parameters and compare expected error
func (*Fixtures) Status ¶
func (f *Fixtures) Status() *ostctypes.ResultStatus
func (*Fixtures) TxBroadcast ¶
TxBroadcast is lfb tx broadcast
func (*Fixtures) TxExecuteWasm ¶
func (*Fixtures) TxGovDeposit ¶
func (f *Fixtures) TxGovDeposit(proposalID int, from string, amount sdk.Coin, flags ...string) (testutil.BufferWriter, error)
TxGovDeposit is lfb tx gov deposit
func (*Fixtures) TxGovSubmitCommunityPoolSpendProposal ¶
func (f *Fixtures) TxGovSubmitCommunityPoolSpendProposal( from, proposalPath string, deposit sdk.Coin, flags ...string, ) (testutil.BufferWriter, error)
TxGovSubmitCommunityPoolSpendProposal executes a CLI community pool spend proposal submission.
func (*Fixtures) TxGovSubmitParamChangeProposal ¶
func (f *Fixtures) TxGovSubmitParamChangeProposal( from, proposalPath string, flags ...string, ) (testutil.BufferWriter, error)
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) (testutil.BufferWriter, error)
TxGovSubmitProposal is lfb tx gov submit-proposal
func (*Fixtures) TxGovVote ¶
func (f *Fixtures) TxGovVote(proposalID int, option gov.VoteOption, from string, flags ...string) (testutil.BufferWriter, error)
TxGovVote is lfb tx gov vote
func (*Fixtures) TxInstantiateWasm ¶
func (*Fixtures) TxMultisign ¶
func (f *Fixtures) TxMultisign(fileName, name string, signaturesFiles []string, flags ...string) (testutil.BufferWriter, error)
TxMultisign is lfb tx multisign
func (*Fixtures) TxSend ¶
func (f *Fixtures) TxSend(from string, to sdk.AccAddress, amount sdk.Coin, flags ...string) (testutil.BufferWriter, error)
TxSend is lfb tx send
func (*Fixtures) TxStakingCreateValidator ¶
func (f *Fixtures) TxStakingCreateValidator(from, consPubKey string, amount sdk.Coin, flags ...string) (testutil.BufferWriter, error)
TxStakingCreateValidator is lfb tx staking create-validator
func (*Fixtures) TxStakingUnbond ¶
func (f *Fixtures) TxStakingUnbond(from, shares string, validator sdk.ValAddress, flags ...string) (testutil.BufferWriter, error)
TxStakingUnbond is lfb tx staking unbond
func (*Fixtures) TxStoreWasm ¶
func (*Fixtures) UnsafeResetAll ¶
UnsafeResetAll is lfb unsafe-reset-all
func (*Fixtures) ValidateGenesis ¶
ValidateGenesis runs lfb validate-genesis