Documentation ¶
Overview ¶
Package network allows to programmatically spin up a local network for CLI tests
Index ¶
- func New(t *testing.T, cfg network.Config) *network.Network
- func NewConfig(appConfig depinject.Config) network.Config
- type AppConstructor
- type BroadcastMode
- type Config
- type Network
- type TestApp
- type TestSuite
- func (s *TestSuite) AccountI(acc account.Account) (sdk.AccountI, error)
- func (s *TestSuite) AllValidators() ([]stakingtypes.Validator, error)
- func (s *TestSuite) Balances(acc account.Account) (sdk.Coins, error)
- func (s *TestSuite) BroadcastTx(ctx context.Context, bz []byte, mode BroadcastMode) (*coretypes.ResultBroadcastTx, error)
- func (s *TestSuite) BroadcastTxCommit(ctx context.Context, bz []byte) (*coretypes.ResultBroadcastTxCommit, error)
- func (s *TestSuite) CreateTxBytes(ctx context.Context, txGen TxGenInfo, msgs ...sdk.Msg) ([]byte, error)
- func (s *TestSuite) CreateValidatorTxBytes(fees sdk.Coin, gas uint64, msgs []sdk.Msg) ([]byte, error)
- func (s *TestSuite) GetCometClient() (*cmthttp.HTTP, error)
- func (s *TestSuite) GetGRPC() (cc *grpc.ClientConn, close func(), err error)
- func (s *TestSuite) ValidatorDelegations(valAddr string) ([]stakingtypes.DelegationResponse, error)
- func (s *TestSuite) ValidatorDistributionInfo(valAddr string) (*distrtypes.QueryValidatorDistributionInfoResponse, error)
- type TxGenInfo
- type ValidatorI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppConstructor ¶
type AppConstructor func(val ValidatorI) TestApp
type BroadcastMode ¶
type BroadcastMode int
BroadcastMode is a type alias for Tx broadcast modes.
const ( BroadcastModeSync BroadcastMode = iota BroadcastModeAsync BroadcastModeCommit )
type TestApp ¶
type TestApp interface { runtime.AppI servertypes.Application }
type TestSuite ¶
type TestSuite struct {
Network *Network
}
TestSuite is a test suite for tests that initializes a network instance.
func (*TestSuite) AllValidators ¶
func (s *TestSuite) AllValidators() ([]stakingtypes.Validator, error)
func (*TestSuite) BroadcastTx ¶
func (s *TestSuite) BroadcastTx(ctx context.Context, bz []byte, mode BroadcastMode) (*coretypes.ResultBroadcastTx, error)
BroadcastTx broadcasts the given Tx in sync or async mode and returns the result.
func (*TestSuite) BroadcastTxCommit ¶
func (s *TestSuite) BroadcastTxCommit(ctx context.Context, bz []byte) (*coretypes.ResultBroadcastTxCommit, error)
BroadcastTxCommit broadcasts the given Tx in commit mode and returns the result.
func (*TestSuite) CreateTxBytes ¶
func (s *TestSuite) CreateTxBytes(ctx context.Context, txGen TxGenInfo, msgs ...sdk.Msg) ([]byte, error)
CreateTxBytes creates and signs a transaction, from the given messages.
func (*TestSuite) CreateValidatorTxBytes ¶
func (s *TestSuite) CreateValidatorTxBytes(fees sdk.Coin, gas uint64, msgs []sdk.Msg) ([]byte, error)
CreateValidatorTxBytes creates tx bytes using the first validators keyring.
func (*TestSuite) GetGRPC ¶
func (s *TestSuite) GetGRPC() (cc *grpc.ClientConn, close func(), err error)
GetGRPC returns a grpc client for the first validator's node.
func (*TestSuite) ValidatorDelegations ¶
func (s *TestSuite) ValidatorDelegations(valAddr string) ([]stakingtypes.DelegationResponse, error)
func (*TestSuite) ValidatorDistributionInfo ¶
func (s *TestSuite) ValidatorDistributionInfo(valAddr string) (*distrtypes.QueryValidatorDistributionInfoResponse, error)
type TxGenInfo ¶
type TxGenInfo struct { Account account.Account GasLimit uint64 TimeoutHeight uint64 Fee sdk.Coins // OverrideSequence will manually set the account sequence for signing using Sequence. OverrideSequence bool // Sequence is the account sequence to be used if OverrideSequence is true. Sequence uint64 }
TxGenInfo contains common info for generating transactions for tests.
type ValidatorI ¶
type ValidatorI = network.ValidatorI