testutil

package
v0.32.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 54 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CoinDenom = "uakt"
)

CoinDenom provides ability to create coins in test functions and pass them into testutil functionality.

Variables

View Source
var DefaultDeploymentVersion = sha256.Sum256([]byte(sum256Seed))

DefaultDeploymentVersion provides consistent sha256 sum for initial Deployment.Version

Functions

func AccAddress added in v0.22.0

func AccAddress(t testing.TB) sdk.AccAddress

AccAddress provides an Account's Address bytes from a ed25519 generated private key.

func AkashCoin added in v0.22.0

func AkashCoin(t testing.TB, amount int64) sdk.Coin

AkashCoin provides simple interface to the Akash sdk.Coin type.

func AkashCoinRandom added in v0.22.0

func AkashCoinRandom(t testing.TB) sdk.Coin

AkashCoinRandom provides simple interface to the Akash sdk.Coin type.

func AkashDecCoin added in v0.22.0

func AkashDecCoin(t testing.TB, amount int64) sdk.DecCoin

func AkashDecCoinRandom added in v0.22.0

func AkashDecCoinRandom(t testing.TB) sdk.DecCoin

func Attribute added in v0.22.0

func Attribute(t testing.TB) types.Attribute

Attribute generates a random sdk.Attribute

func Attributes added in v0.22.0

func Attributes(t testing.TB) []types.Attribute

Attributes generates a set of sdk.Attribute

func AuditedProvider added in v0.22.0

func AuditedProvider(t testing.TB) (atypes.ProviderID, atypes.Provider)

func BidID added in v0.22.0

func BidID(t testing.TB) mtypes.BidID

func BidIDForAccount added in v0.22.0

func BidIDForAccount(t testing.TB, owner, provider sdk.Address) mtypes.BidID

func CertificateRequireEqualResponse added in v0.22.0

func CertificateRequireEqualResponse(t *testing.T, cert TestCertificate, resp types.CertificateResponse, state types.Certificate_State)

func ChannelWaitForClose added in v0.22.0

func ChannelWaitForClose(t *testing.T, waitOn interface{})

func ChannelWaitForCloseUpTo added in v0.22.0

func ChannelWaitForCloseUpTo(t *testing.T, waitOn interface{}, waitFor time.Duration)

func ChannelWaitForValue added in v0.22.0

func ChannelWaitForValue(t *testing.T, waitOn interface{}) interface{}

func ChannelWaitForValueUpTo added in v0.22.0

func ChannelWaitForValueUpTo(t *testing.T, waitOn interface{}, waitFor time.Duration) interface{}

func Coin added in v0.22.0

func Coin(t testing.TB) sdk.Coin

func DecCoin added in v0.22.0

func DecCoin(t testing.TB) sdk.DecCoin

func DefaultConfig added in v0.22.0

func DefaultConfig(opts ...ConfigOption) network.Config

DefaultConfig returns a default configuration suitable for nearly all testing requirements.

func Deployment

func Deployment(t testing.TB) dtypes.Deployment

Deployment generates a dtype.Deployment in state `DeploymentActive`

func DeploymentGroup added in v0.3.0

func DeploymentGroup(t testing.TB, did dtypes.DeploymentID, gseq uint32) dtypes.Group

DeploymentGroup generates a dtype.DepDeploymentGroup in state `GroupOpen` with a set of random required attributes

func DeploymentGroups added in v0.0.2

func DeploymentGroups(t testing.TB, did dtypes.DeploymentID, gseq uint32) []dtypes.Group

DeploymentGroups returns a set of deployment groups generated by DeploymentGroup

func DeploymentID added in v0.22.0

func DeploymentID(t testing.TB) dtypes.DeploymentID

func DeploymentIDForAccount added in v0.22.0

func DeploymentIDForAccount(t testing.TB, addr sdk.Address) dtypes.DeploymentID

func DeploymentVersion added in v0.22.0

func DeploymentVersion(t testing.TB) []byte

DeploymentVersion provides a random sha256 sum for simulating Deployments.

func GroupID added in v0.22.0

func GroupID(t testing.TB) dtypes.GroupID

func GroupIDForAccount added in v0.22.0

func GroupIDForAccount(t testing.TB, addr sdk.Address) dtypes.GroupID

func GroupSpec added in v0.22.0

func GroupSpec(t testing.TB) dtypes.GroupSpec

GroupSpec generator

func Hostname added in v0.22.0

func Hostname(t testing.TB) string

Hostname generates a random hostname with a "test.com" domain

func Key added in v0.22.0

func Key(t testing.TB) ed25519.PrivKey

func Keyring added in v0.22.0

func Keyring(t testing.TB) keyring.Keyring

func LeaseID added in v0.22.0

func LeaseID(t testing.TB) mtypes.LeaseID

func LeaseIDForAccount added in v0.22.0

func LeaseIDForAccount(t testing.TB, owner, provider sdk.Address) mtypes.LeaseID

func Logger

func Logger(t testing.TB) log.Logger

func Name added in v0.22.0

func Name(_ testing.TB, prefix string) string

Name generates a random name with the given prefix

func OrderID added in v0.22.0

func OrderID(t testing.TB) mtypes.OrderID

func OrderIDForAccount added in v0.22.0

func OrderIDForAccount(t testing.TB, addr sdk.Address) mtypes.OrderID

func ParseDeploymentEvent added in v0.22.0

func ParseDeploymentEvent(t testing.TB, events []abci.Event) sdkutil.ModuleEvent

func ParseEvent added in v0.22.0

func ParseEvent(t testing.TB, events []abci.Event) sdkutil.Event

func ParseMarketEvent added in v0.22.0

func ParseMarketEvent(t testing.TB, events []abci.Event) sdkutil.ModuleEvent

func ParseProviderEvent added in v0.22.0

func ParseProviderEvent(t testing.TB, events []abci.Event) sdkutil.ModuleEvent

func PlacementRequirements added in v0.22.0

func PlacementRequirements(t testing.TB) types.PlacementRequirements

PlacementRequirements generates placement requirements

func Provider

func Provider(t testing.TB) ptypes.Provider

func ProviderHostname added in v0.22.0

func ProviderHostname(t testing.TB) string

func RandCPUUnits added in v0.22.0

func RandCPUUnits() uint

func RandGPUUnits added in v0.24.0

func RandGPUUnits() uint

func RandMemoryQuantity added in v0.22.0

func RandMemoryQuantity() uint64

func RandRangeInt added in v0.22.0

func RandRangeInt(min, max int) int

func RandRangeUint added in v0.22.0

func RandRangeUint(min, max uint) uint

func RandRangeUint64 added in v0.22.0

func RandRangeUint64(min, max uint64) uint64

func RandStorageQuantity added in v0.22.0

func RandStorageQuantity() uint64

func ResourceUnits added in v0.22.0

func ResourceUnits(_ testing.TB) types.Resources

func Resources added in v0.22.0

func Resources(t testing.TB) []dtypes.ResourceUnit

Resources produces an attribute list for populating a Group's 'Resources' fields.

Types

type CertificateOption added in v0.22.0

type CertificateOption func(*certificateOption)

func CertificateOptionDomains added in v0.22.0

func CertificateOptionDomains(domains []string) CertificateOption

func CertificateOptionMocks added in v0.22.0

func CertificateOptionMocks(val *clientmocks.QueryClient) CertificateOption

func CertificateOptionNotAfter added in v0.22.0

func CertificateOptionNotAfter(tm time.Time) CertificateOption

func CertificateOptionNotBefore added in v0.22.0

func CertificateOptionNotBefore(tm time.Time) CertificateOption

type ConfigOption added in v0.24.0

type ConfigOption func(*networkConfigOptions)

func WithInterceptState added in v0.24.0

func WithInterceptState(val InterceptState) ConfigOption

WithInterceptState set custom name of the log object

type InterceptState added in v0.24.0

type InterceptState func(codec.Codec, string, json.RawMessage) json.RawMessage

type NetworkTestSuite added in v0.22.0

type NetworkTestSuite struct {
	*suite.Suite
	// contains filtered or unexported fields
}

func NewNetworkTestSuite added in v0.22.0

func NewNetworkTestSuite(cfg *network.Config, container interface{}) NetworkTestSuite

func (*NetworkTestSuite) Config added in v0.22.0

func (nts *NetworkTestSuite) Config() network.Config

func (*NetworkTestSuite) Context added in v0.22.0

func (nts *NetworkTestSuite) Context(idxT ...int) sdkclient.Context

func (*NetworkTestSuite) ContextForTest added in v0.22.0

func (nts *NetworkTestSuite) ContextForTest() sdkclient.Context

func (*NetworkTestSuite) GoContextForTest added in v0.22.0

func (nts *NetworkTestSuite) GoContextForTest() context.Context

func (*NetworkTestSuite) Network added in v0.22.0

func (nts *NetworkTestSuite) Network() *network.Network

func (*NetworkTestSuite) SetupSuite added in v0.22.0

func (nts *NetworkTestSuite) SetupSuite()

func (*NetworkTestSuite) SetupTest added in v0.22.0

func (nts *NetworkTestSuite) SetupTest()

func (*NetworkTestSuite) TearDownSuite added in v0.22.0

func (nts *NetworkTestSuite) TearDownSuite()

func (*NetworkTestSuite) TearDownTest added in v0.22.0

func (nts *NetworkTestSuite) TearDownTest()

func (*NetworkTestSuite) ValidateTx added in v0.22.0

func (nts *NetworkTestSuite) ValidateTx(resultData []byte) string

func (*NetworkTestSuite) Validator added in v0.22.0

func (nts *NetworkTestSuite) Validator(idxT ...int) *network.Validator

func (*NetworkTestSuite) WalletForTest added in v0.22.0

func (nts *NetworkTestSuite) WalletForTest() sdk.AccAddress

func (*NetworkTestSuite) WalletNameForTest added in v0.22.0

func (nts *NetworkTestSuite) WalletNameForTest() string

type TestCertificate added in v0.22.0

type TestCertificate struct {
	Cert   []tls.Certificate
	Serial big.Int
	PEM    struct {
		Cert []byte
		Priv []byte
		Pub  []byte
	}
}

func Certificate added in v0.22.0

func Certificate(t testing.TB, addr sdk.Address, opts ...CertificateOption) TestCertificate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL