Documentation
¶
Index ¶
- Constants
- Variables
- func AccAddress(t testing.TB) sdk.AccAddress
- func AkashCoin(t testing.TB, amount int64) sdk.Coin
- func AkashCoinRandom(t testing.TB) sdk.Coin
- func AkashDecCoin(t testing.TB, amount int64) sdk.DecCoin
- func AkashDecCoinRandom(t testing.TB) sdk.DecCoin
- func Attribute(t testing.TB) attrv1.Attribute
- func Attributes(t testing.TB) attrv1.Attributes
- func AuditedProvider(t testing.TB) (atypes.ProviderID, atypes.AuditedProvider)
- func BidID(t testing.TB) mtypes.BidID
- func BidIDForAccount(t testing.TB, owner, provider sdk.Address) mtypes.BidID
- func CertificateRequireEqualResponse(t *testing.T, cert TestCertificate, resp types.CertificateResponse, ...)
- func ChannelWaitForClose(t *testing.T, waitOn interface{})
- func ChannelWaitForCloseUpTo(t *testing.T, waitOn interface{}, waitFor time.Duration)
- func ChannelWaitForValue(t *testing.T, waitOn interface{}) interface{}
- func ChannelWaitForValueUpTo(t *testing.T, waitOn interface{}, waitFor time.Duration) interface{}
- func Coin(t testing.TB) sdk.Coin
- func DecCoin(t testing.TB) sdk.DecCoin
- func Deployment(t testing.TB) dtypes.Deployment
- func DeploymentGroup(t testing.TB, did dtypes.DeploymentID, gseq uint32) v1beta4.Group
- func DeploymentGroups(t testing.TB, did dtypes.DeploymentID, gseq uint32) v1beta4.Groups
- func DeploymentID(t testing.TB) dtypes.DeploymentID
- func DeploymentIDForAccount(t testing.TB, addr sdk.Address) dtypes.DeploymentID
- func DeploymentVersion(t testing.TB) []byte
- func GroupID(t testing.TB) dtypes.GroupID
- func GroupIDForAccount(t testing.TB, addr sdk.Address) dtypes.GroupID
- func GroupSpec(t testing.TB) v1beta4.GroupSpec
- func Hostname(t testing.TB) string
- func Key(t testing.TB) ed25519.PrivKey
- func Keyring(t testing.TB, cdc codec.Codec) keyring.Keyring
- func LeaseID(t testing.TB) mtypes.LeaseID
- func LeaseIDForAccount(t testing.TB, owner, provider sdk.Address) mtypes.LeaseID
- func Logger(t testing.TB) log.Logger
- func Name(_ testing.TB, prefix string) string
- func NewTestNetworkFixture() network.TestFixture
- func OrderID(t testing.TB) mtypes.OrderID
- func OrderIDForAccount(t testing.TB, addr sdk.Address) mtypes.OrderID
- func PlacementRequirements(t testing.TB) attrv1.PlacementRequirements
- func Provider(t testing.TB) ptypes.Provider
- func ProviderHostname(t testing.TB) string
- func RandCPUUnits() uint
- func RandGPUUnits() uint
- func RandMemoryQuantity() uint64
- func RandRangeInt(min, max int) int
- func RandRangeUint(min, max uint) uint
- func RandRangeUint64(min, max uint64) uint64
- func RandStorageQuantity() uint64
- func ResourceUnits(_ testing.TB) rtypes.Resources
- func Resources(t testing.TB) dtypes.ResourceUnits
- type CertificateOption
- type NetworkTestSuite
- func (nts *NetworkTestSuite) ClientContext(idxT ...int) sdkclient.Context
- func (nts *NetworkTestSuite) ClientContextForTest() sdkclient.Context
- func (nts *NetworkTestSuite) Config() network.Config
- func (nts *NetworkTestSuite) ContextForTest() context.Context
- func (nts *NetworkTestSuite) Network() *network.Network
- func (nts *NetworkTestSuite) SetupSuite()
- func (nts *NetworkTestSuite) SetupTest()
- func (nts *NetworkTestSuite) TearDownSuite()
- func (nts *NetworkTestSuite) TearDownTest()
- func (nts *NetworkTestSuite) ValidateTx(resultData []byte) string
- func (nts *NetworkTestSuite) Validator(idxT ...int) *network.Validator
- func (nts *NetworkTestSuite) WalletForTest() sdk.AccAddress
- func (nts *NetworkTestSuite) WalletNameForTest() string
- type TestCertificate
Constants ¶
const (
CoinDenom = "uakt"
)
CoinDenom provides ability to create coins in test functions and pass them into testutil functionality.
Variables ¶
var DefaultDeploymentHash = sha256.Sum256([]byte(sum256Seed))
DefaultDeploymentHash provides consistent sha256 sum for initial Deployment.Hash
Functions ¶
func AccAddress ¶
func AccAddress(t testing.TB) sdk.AccAddress
AccAddress provides an Account's Address bytes from a ed25519 generated private key.
func AkashCoinRandom ¶
AkashCoinRandom provides simple interface to the Akash sdk.Coin type.
func Attributes ¶
func Attributes(t testing.TB) attrv1.Attributes
Attributes generates a set of sdk.Attribute
func AuditedProvider ¶
func AuditedProvider(t testing.TB) (atypes.ProviderID, atypes.AuditedProvider)
func CertificateRequireEqualResponse ¶
func CertificateRequireEqualResponse(t *testing.T, cert TestCertificate, resp types.CertificateResponse, state types.State)
func ChannelWaitForClose ¶
func ChannelWaitForCloseUpTo ¶
func ChannelWaitForValue ¶
func ChannelWaitForValueUpTo ¶
func Deployment ¶
func Deployment(t testing.TB) dtypes.Deployment
Deployment generates a dtype.Deployment in state `DeploymentActive`
func DeploymentGroup ¶ added in v0.3.0
DeploymentGroup generates a dtype.DepDeploymentGroup in state `GroupOpen` with a set of random required attributes
func DeploymentGroups ¶ added in v0.0.2
DeploymentGroups returns a set of deployment groups generated by DeploymentGroup
func DeploymentID ¶
func DeploymentID(t testing.TB) dtypes.DeploymentID
func DeploymentIDForAccount ¶
func DeploymentVersion ¶
DeploymentVersion provides a random sha256 sum for simulating Deployments.
func LeaseIDForAccount ¶
func NewTestNetworkFixture ¶ added in v1.0.0
func NewTestNetworkFixture() network.TestFixture
NewTestNetworkFixture returns a new simapp AppConstructor for network simulation tests
func PlacementRequirements ¶
func PlacementRequirements(t testing.TB) attrv1.PlacementRequirements
PlacementRequirements generates placement requirements
func ProviderHostname ¶
func RandCPUUnits ¶
func RandCPUUnits() uint
func RandGPUUnits ¶
func RandGPUUnits() uint
func RandMemoryQuantity ¶
func RandMemoryQuantity() uint64
func RandRangeInt ¶
func RandRangeUint ¶
func RandRangeUint64 ¶
func RandStorageQuantity ¶
func RandStorageQuantity() uint64
Types ¶
type CertificateOption ¶
type CertificateOption func(*certificateOption)
func CertificateOptionDomains ¶
func CertificateOptionDomains(domains []string) CertificateOption
func CertificateOptionMocks ¶
func CertificateOptionMocks(val *clientmocks.QueryClient) CertificateOption
func CertificateOptionNotAfter ¶
func CertificateOptionNotAfter(tm time.Time) CertificateOption
func CertificateOptionNotBefore ¶
func CertificateOptionNotBefore(tm time.Time) CertificateOption
type NetworkTestSuite ¶ added in v1.0.0
func NewNetworkTestSuite ¶ added in v1.0.0
func NewNetworkTestSuite(cfg *network.Config, container interface{}) *NetworkTestSuite
func (*NetworkTestSuite) ClientContext ¶ added in v1.0.0
func (nts *NetworkTestSuite) ClientContext(idxT ...int) sdkclient.Context
func (*NetworkTestSuite) ClientContextForTest ¶ added in v1.0.0
func (nts *NetworkTestSuite) ClientContextForTest() sdkclient.Context
func (*NetworkTestSuite) Config ¶ added in v1.0.0
func (nts *NetworkTestSuite) Config() network.Config
func (*NetworkTestSuite) ContextForTest ¶ added in v1.0.0
func (nts *NetworkTestSuite) ContextForTest() context.Context
func (*NetworkTestSuite) Network ¶ added in v1.0.0
func (nts *NetworkTestSuite) Network() *network.Network
func (*NetworkTestSuite) SetupSuite ¶ added in v1.0.0
func (nts *NetworkTestSuite) SetupSuite()
func (*NetworkTestSuite) SetupTest ¶ added in v1.0.0
func (nts *NetworkTestSuite) SetupTest()
func (*NetworkTestSuite) TearDownSuite ¶ added in v1.0.0
func (nts *NetworkTestSuite) TearDownSuite()
func (*NetworkTestSuite) TearDownTest ¶ added in v1.0.0
func (nts *NetworkTestSuite) TearDownTest()
func (*NetworkTestSuite) ValidateTx ¶ added in v1.0.0
func (nts *NetworkTestSuite) ValidateTx(resultData []byte) string
func (*NetworkTestSuite) Validator ¶ added in v1.0.0
func (nts *NetworkTestSuite) Validator(idxT ...int) *network.Validator
func (*NetworkTestSuite) WalletForTest ¶ added in v1.0.0
func (nts *NetworkTestSuite) WalletForTest() sdk.AccAddress
func (*NetworkTestSuite) WalletNameForTest ¶ added in v1.0.0
func (nts *NetworkTestSuite) WalletNameForTest() string
type TestCertificate ¶
type TestCertificate struct {
Cert []tls.Certificate
Serial big.Int
PEM struct {
Cert []byte
Priv []byte
Pub []byte
}
}
func Certificate ¶
func Certificate(t testing.TB, addr sdk.Address, opts ...CertificateOption) TestCertificate