Documentation
¶
Index ¶
- func ApplicationModuleGenesisStateWithAddresses(t *testing.T, addresses []string) *apptypes.GenesisState
- func DefaultApplicationModuleGenesisState(t *testing.T, n int) *apptypes.GenesisState
- func DefaultConfig() network.Config
- func DefaultConfigWithPorts() network.Config
- func DefaultGatewayModuleGenesisState(t *testing.T, n int) *gatewaytypes.GenesisState
- func DefaultSupplierModuleGenesisState(t *testing.T, n int) *suppliertypes.GenesisState
- func DefaultTokenomicsModuleGenesisState(t *testing.T) *tokenomicstypes.GenesisState
- func DelegateAppToGateway(t *testing.T, net *Network, appAddr string, gatewayAddr string)
- func GatewayModuleGenesisStateWithAddresses(t *testing.T, addresses []string) *gatewaytypes.GenesisState
- func InitAccount(t *testing.T, net *Network, addr sdk.AccAddress)
- func InitAccountWithSequence(t *testing.T, net *Network, addr sdk.AccAddress, signatureSequencerNumber int)
- func NewBondDenomCoins(t *testing.T, net *network.Network, numCoins int64) sdk.Coins
- func ProofModuleGenesisStateWithClaims(t *testing.T, claims []prooftypes.Claim) *prooftypes.GenesisState
- func SupplierModuleGenesisStateWithAddresses(t *testing.T, addresses []string) *suppliertypes.GenesisState
- func UndelegateAppFromGateway(t *testing.T, net *Network, appAddr string, gatewayAddr string)
- func WaitForAccountOnChain(t *testing.T, net *Network, addr sdk.AccAddress)
- type Config
- type Network
- type TestLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicationModuleGenesisStateWithAddresses ¶
func ApplicationModuleGenesisStateWithAddresses(t *testing.T, addresses []string) *apptypes.GenesisState
ApplicationModuleGenesisStateWithAccount generates a GenesisState object with a single application for each of the given addresses.
func DefaultApplicationModuleGenesisState ¶
func DefaultApplicationModuleGenesisState(t *testing.T, n int) *apptypes.GenesisState
DefaultApplicationModuleGenesisState generates a GenesisState object with a given number of applications. It returns the populated GenesisState object.
func DefaultConfig ¶
DefaultConfig will initialize config for the network with custom application, genesis and single validator. All other parameters are inherited from cosmos-sdk/testutil/network.DefaultConfig
func DefaultConfigWithPorts ¶ added in v0.1.27
DefaultConfigWithPorts allocates ports safely within the lock and returns the config
func DefaultGatewayModuleGenesisState ¶
func DefaultGatewayModuleGenesisState(t *testing.T, n int) *gatewaytypes.GenesisState
DefaultGatewayModuleGenesisState generates a GenesisState object with a given number of gateways. It returns the populated GenesisState object.
func DefaultSupplierModuleGenesisState ¶
func DefaultSupplierModuleGenesisState(t *testing.T, n int) *suppliertypes.GenesisState
DefaultSupplierModuleGenesisState generates a GenesisState object with a given number of suppliers. It returns the populated GenesisState object.
func DefaultTokenomicsModuleGenesisState ¶
func DefaultTokenomicsModuleGenesisState(t *testing.T) *tokenomicstypes.GenesisState
func DelegateAppToGateway ¶
DelegateAppToGateway delegates the provided application to the provided gateway
func GatewayModuleGenesisStateWithAddresses ¶
func GatewayModuleGenesisStateWithAddresses(t *testing.T, addresses []string) *gatewaytypes.GenesisState
GatewayModuleGenesisStateWithAddresses generates a GenesisState object with a gateway list full of gateways with the given addresses. It returns the populated GenesisState object.
func InitAccount ¶
func InitAccount(t *testing.T, net *Network, addr sdk.AccAddress)
InitAccount initializes an Account by sending it some funds from the validator in the network to the address provided, and blocks until that account is readable onchain.
func InitAccountWithSequence ¶
func InitAccountWithSequence( t *testing.T, net *Network, addr sdk.AccAddress, signatureSequencerNumber int, )
InitAccountWithSequence initializes an Account by sending it some funds from the validator in the network to the address provided, and blocks until that account is readable onchain.
The explicit sequence exists so a caller can fund several accounts back to back without re-querying the validator's sequence between sends. Blocking on each account does not invalidate those pre-assigned sequences — committing the sends one at a time, in order, is exactly what they describe.
func NewBondDenomCoins ¶
TODO_TECHDEBT: Reuse this helper in all test helpers where appropriate.
func ProofModuleGenesisStateWithClaims ¶ added in v0.0.3
func ProofModuleGenesisStateWithClaims(t *testing.T, claims []prooftypes.Claim) *prooftypes.GenesisState
ProofModuleGenesisStateWithClaims generates a GenesisState object with the given claims. It returns the populated GenesisState object.
func SupplierModuleGenesisStateWithAddresses ¶
func SupplierModuleGenesisStateWithAddresses(t *testing.T, addresses []string) *suppliertypes.GenesisState
SupplierModuleGenesisStateWithAddresses generates a GenesisState object with a single supplier for each of the given addresses.
func UndelegateAppFromGateway ¶
UndelegateAppFromGateway undelegates the provided application from the provided gateway
func WaitForAccountOnChain ¶ added in v0.1.35
func WaitForAccountOnChain(t *testing.T, net *Network, addr sdk.AccAddress)
WaitForAccountOnChain blocks until addr is readable from the auth module, or fails the test after maxBlocksToWaitForAccountOnChain blocks.
BroadcastSync only confirms that the funding tx passed CheckTx and entered the mempool; the account does not exist onchain until that tx is included in a committed block. A caller that immediately builds another tx from this address queries for its account number and sequence, and loses the race with:
rpc error: code = NotFound desc = account pokt1... not found: key not found
Waiting a fixed single block is not enough — whether the funding tx makes the very next block depends on proposer timing, so the wait must be on the account actually appearing.
Types ¶
type TestLock ¶ added in v0.1.27
type TestLock struct {
// contains filtered or unexported fields
}
TestLock provides a file-based mutex to coordinate test execution across modules. This prevents inter-module race conditions when multiple modules try to use network resources (leveldb, ports, etc.) simultaneously.
func NewTestLock ¶ added in v0.1.27
NewTestLock creates a new test lock using a file in the system temp directory.