testutil

package
v0.7.21-doubletap.rc22 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoinDenom  = "uakt"
	BechPrefix = "akash"
)

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

Variables

View Source
var (
	// DefaultManifestGenerator is the default test manifest generator
	DefaultManifestGenerator = RandManifestGenerator

	// ManifestGenerators is a list of all available manifest generators
	ManifestGenerators = []struct {
		Name      string
		Generator ManifestGenerator
	}{
		{"overflow", OverflowManifestGenerator},
		{"random", RandManifestGenerator},
		{"app", AppManifestGenerator},
	}
)
View Source
var DefaultDeploymentVersion = sha256.Sum256([]byte(sum256Seed))

DefaultDeploymentVersion provides consistent sha256 sum for initial Deployment.Version

Functions

func AccAddress added in v0.7.3

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.7.8

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

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

func Attribute added in v0.7.3

func Attribute(t testing.TB) types.Attribute

Attribute generates a random sdk.Attribute

func Attributes added in v0.7.3

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

Attributes generates a set of sdk.Attribute

func BidID added in v0.7.3

func BidID(t testing.TB) mtypes.BidID

func Coin added in v0.7.3

func Coin(t testing.TB) sdk.Coin

func DefaultConfig added in v0.9.1

func DefaultConfig() 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.7.3

func DeploymentID(t testing.TB) dtypes.DeploymentID

func DeploymentVersion added in v0.7.8

func DeploymentVersion(t testing.TB) []byte

DeploymentVersion provides a random sha256 sum for simulating Deployments.

func GroupID added in v0.7.3

func GroupID(t testing.TB) dtypes.GroupID

func GroupSpec added in v0.7.8

func GroupSpec(t testing.TB) dtypes.GroupSpec

GroupSpec generator

func Hostname added in v0.7.3

func Hostname(t testing.TB) string

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

func Keyring added in v0.7.3

func Keyring(t testing.TB) keyring.Keyring

func LeaseID added in v0.7.3

func LeaseID(t testing.TB) mtypes.LeaseID

func Logger

func Logger(t testing.TB) log.Logger

func Name added in v0.7.3

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

Name generates a random name with the given prefix

func OrderID added in v0.7.3

func OrderID(t testing.TB) mtypes.OrderID

func ParseDeploymentEvent added in v0.7.3

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

func ParseEvent added in v0.7.3

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

func ParseMarketEvent added in v0.7.4

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

func ParseProviderEvent added in v0.7.4

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

func Provider

func Provider(t testing.TB) ptypes.Provider

func RandRangeInt added in v0.9.1

func RandRangeInt(min, max int) int

func ResourceUnits added in v0.9.1

func ResourceUnits(_ testing.TB) types.ResourceUnits

func Resources added in v0.7.3

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

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

Types

type ManifestGenerator added in v0.7.3

type ManifestGenerator interface {
	Manifest(t testing.TB) manifest.Manifest
	Group(t testing.TB) manifest.Group
	Service(t testing.TB) manifest.Service
	ServiceExpose(t testing.TB) manifest.ServiceExpose
}

ManifestGenerator is an interface for generating test manifests

var AppManifestGenerator ManifestGenerator = manifestGeneratorApp{}

AppManifestGenerator represents a real-world, deployable configuration.

var OverflowManifestGenerator ManifestGenerator = manifestGeneratorOverflow{}

OverflowManifestGenerator generates a manifest maximum integer values

var RandManifestGenerator ManifestGenerator = manifestGeneratorRand{}

RandManifestGenerator generates a manifest with random values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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