Documentation ¶
Index ¶
- func LookupEnvBool(t *testing.T, key string) (envBool bool, found bool)
- func LookupEnvBoolWithDefault(t *testing.T, key string, defaultValue bool) bool
- func LookupEnvInt(t *testing.T, key string) (envInt int, found bool)
- func LookupEnvIntWithDefault(t *testing.T, key string, defaultValue int) int
- func LookupEnvStringArray(t *testing.T, key string) (envStringArray []string, found bool)
- func LookupEnvStringArrayWithDefault(t *testing.T, key string, defaultValue []string) []string
- type Client
- func (c *Client) AccountRegistryCreate(name string) (acc cosmosaccount.Account, mnemonic string, err error)
- func (c *Client) AccountRegistryGetByName(name string) (cosmosaccount.Account, error)
- func (c *Client) BlockHeight(ctx context.Context) (int64, error)
- func (c *Client) BroadcastTx(ctx context.Context, account cosmosaccount.Account, msgs ...sdktypes.Msg) (cosmosclient.Response, error)
- func (c *Client) Context() sdkclient.Context
- func (c *Client) QueryAuth() authtypes.QueryClient
- func (c *Client) QueryBank() banktypes.QueryClient
- func (c *Client) QueryDistribution() distributiontypes.QueryClient
- func (c *Client) QueryEmissions() emissionstypes.QueryServiceClient
- func (c *Client) QueryGov() govtypesv1.QueryClient
- func (c *Client) QueryMint() minttypes.QueryServiceClient
- func (c *Client) QueryUpgrade() upgradetypes.QueryClient
- func (c *Client) WaitForBlockHeight(ctx context.Context, height int64) error
- func (c *Client) WaitForNextBlock(ctx context.Context) error
- func (c *Client) WaitForTx(ctx context.Context, hash string) (*coretypes.ResultTx, error)
- type RandomKeyMap
- func (rkm *RandomKeyMap[K, V]) Delete(k K)
- func (rkm *RandomKeyMap[K, V]) Filter(f func(K) bool) ([]K, []V)
- func (rkm *RandomKeyMap[K, V]) Get(k K) (V, bool)
- func (rkm *RandomKeyMap[K, V]) GetAll() []V
- func (rkm *RandomKeyMap[K, V]) Len() int
- func (rkm *RandomKeyMap[K, V]) RandomKey() (*K, error)
- func (rkm *RandomKeyMap[K, V]) Upsert(k K, v V)
- type RpcConnectionType
- type TestConfig
- type ValueIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupEnvBool ¶
helper function to look up a boolean from the environment variable key
func LookupEnvBoolWithDefault ¶ added in v0.7.0
helper function to look up a boolean from the environment variable key and return a passed-in default value if the environment variable is not set
func LookupEnvInt ¶
helper function to look up an integer from the environment variable key
func LookupEnvIntWithDefault ¶ added in v0.7.0
helper function to look up an integer from the environment variable key and return a passed-in default value if the environment variable is not set
func LookupEnvStringArray ¶
helper function to look up a string array from the environment variable key
func LookupEnvStringArrayWithDefault ¶ added in v0.7.0
helper function to look up a string array from the environment variable key and return a passed-in default value if the environment variable is not set
Types ¶
type Client ¶
type Client struct { RpcConnectionType RpcConnectionType // what kind of rpc connection to use Clients []cosmosclient.Client // clients to attach to QueryAuths []authtypes.QueryClient // query clients for auth QueryBanks []banktypes.QueryClient // query clients for bank QueryDistributions []distributiontypes.QueryClient // query clients for distribution QueryEmissionses []emissionstypes.QueryServiceClient // query clients for emissions QueryMints []minttypes.QueryServiceClient // query clients for mint QueryGovs []govtypesv1.QueryClient // query clients for gov QueryUpgrades []upgradetypes.QueryClient // query clients for upgrades RpcCounterSeed int64 // if round-robin which RPC to use next, if random, seed to use RpcCounterMutex *sync.Mutex // mutex for the counter Rand *rand.Rand // random number generator // contains filtered or unexported fields }
where to get ahold of a node
func NewClient ¶
func NewClient( t *testing.T, rpcConnectionType RpcConnectionType, nodeRpcAddresses []string, alloraHomeDir string, seed int64, ) Client
create a new appchain client that we can use
func (*Client) AccountRegistryCreate ¶
func (*Client) AccountRegistryGetByName ¶
func (c *Client) AccountRegistryGetByName(name string) ( cosmosaccount.Account, error, )
func (*Client) BroadcastTx ¶
func (c *Client) BroadcastTx( ctx context.Context, account cosmosaccount.Account, msgs ...sdktypes.Msg, ) (cosmosclient.Response, error)
func (*Client) QueryAuth ¶
func (c *Client) QueryAuth() authtypes.QueryClient
/ Accessors for Query Clients. These don't have to be concurrency aware because they are read only, and the RPC endpoint should handle concurrency.
func (*Client) QueryBank ¶
func (c *Client) QueryBank() banktypes.QueryClient
func (*Client) QueryDistribution ¶
func (c *Client) QueryDistribution() distributiontypes.QueryClient
func (*Client) QueryEmissions ¶
func (c *Client) QueryEmissions() emissionstypes.QueryServiceClient
func (*Client) QueryGov ¶
func (c *Client) QueryGov() govtypesv1.QueryClient
func (*Client) QueryMint ¶
func (c *Client) QueryMint() minttypes.QueryServiceClient
func (*Client) QueryUpgrade ¶
func (c *Client) QueryUpgrade() upgradetypes.QueryClient
func (*Client) WaitForBlockHeight ¶
type RandomKeyMap ¶ added in v0.2.13
type RandomKeyMap[K comparable, V any] struct { // contains filtered or unexported fields }
RandomKeyMap is a map that is O(1) for insertion, deletion, and random key selection Note that because rand.Rand is not safe for concurrent use, neither is RandomKeyMap
func NewRandomKeyMap ¶ added in v0.2.13
func NewRandomKeyMap[K comparable, V any](r *rand.Rand) *RandomKeyMap[K, V]
RandomKeyMap is a map that is O(1) for insertion, deletion, and random key selection
func (*RandomKeyMap[K, V]) Delete ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) Delete(k K)
Remove element from the map by swapping in the last element in its place.
func (*RandomKeyMap[K, V]) Filter ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) Filter(f func(K) bool) ([]K, []V)
Filter returns all elements from the map that satisfy the predicate
func (*RandomKeyMap[K, V]) Get ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) Get(k K) (V, bool)
Get returns an element from the map
func (*RandomKeyMap[K, V]) GetAll ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) GetAll() []V
GetAll returns all elements from the map
func (*RandomKeyMap[K, V]) Len ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) Len() int
length of the map & slice
func (*RandomKeyMap[K, V]) RandomKey ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) RandomKey() (*K, error)
Get a random key from the map
func (*RandomKeyMap[K, V]) Upsert ¶ added in v0.2.13
func (rkm *RandomKeyMap[K, V]) Upsert(k K, v V)
Upsert element into the map
type RpcConnectionType ¶
type RpcConnectionType = uint8
const ( SingleRpc RpcConnectionType = iota RoundRobin RandomBasedOnDeterministicSeed )
func LookupRpcMode ¶
func LookupRpcMode(t *testing.T, key string) (rpcMode RpcConnectionType, found bool)
helper function to look up the rpc mode from the environment variable key
func LookupRpcModeWithDefault ¶ added in v0.7.0
func LookupRpcModeWithDefault(t *testing.T, key string, defaultValue RpcConnectionType) RpcConnectionType
helper function to look up the rpc mode from the environment variable key and return a passed-in default value if the environment variable is not set
func StringToRpcConnectionType ¶ added in v0.7.0
func StringToRpcConnectionType(t *testing.T, value string) RpcConnectionType
helper function to convert a string to a RpcConnectionType
type TestConfig ¶
type TestConfig struct { T *testing.T Client Client // a testcommon.Client which holds several cosmosclient.Client instances AlloraHomeDir string // home directory for the allora keystore FaucetAcc cosmosaccount.Account // account info for the faucet FaucetAddr string // faucets address, string encoded bech32 UpshotAcc cosmosaccount.Account // account info for the upshot account UpshotAddr string // upshot address, string encoded bech32 AliceAcc cosmosaccount.Account // account info for the alice test account AliceAddr string // alice address, string encoded bech32 BobAcc cosmosaccount.Account // account info for the bob test account BobAddr string // bob address, string encoded bech32 Validator0Acc cosmosaccount.Account // account info for the validator0 test account Validator0Addr string // validator0 address, string encoded bech32 Validator1Acc cosmosaccount.Account // account info for the validator1 test account Validator1Addr string // validator1 address, string encoded bech32 Validator2Acc cosmosaccount.Account // account info for the validator2 test account Validator2Addr string // validator2 address, string encoded bech32 Cdc codec.Codec // common codec for encoding/decoding Seed int // global non-mutable seed used for naming the test run }
handle to various node data
func NewTestConfig ¶
func NewTestConfig( t *testing.T, rpcConnectionType RpcConnectionType, nodeRpcAddresses []string, alloraHomeDir string, seed int, ) TestConfig
create a new config that we can use
type ValueIndex ¶ added in v0.2.13
type ValueIndex[V any] struct { // contains filtered or unexported fields }