Documentation
¶
Index ¶
- Constants
- Variables
- func AccAddress(t testing.TB) types.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) attr.Attribute
- func Attributes(t testing.TB) []attr.Attribute
- 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) dtypesv1beta4.Group
- func DeploymentGroups(t testing.TB, did dtypes.DeploymentID, gseq uint32) dtypesv1beta4.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) dtypesv1beta4.GroupSpec
- func Hostname(t testing.TB) string
- func Key(t testing.TB) cryptotypes.PrivKey
- 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 NewAppConfig(opts ...ModuleOption) depinject.Config
- func OrderID(t testing.TB) mtypes.OrderID
- func OrderIDForAccount(t testing.TB, addr sdk.Address) mtypes.OrderID
- func PlacementRequirements(t testing.TB) attr.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(minVal, maxVal int) int
- func RandRangeUint(minVal, maxVal uint) uint
- func RandRangeUint64(minVal, maxVal uint64) uint64
- func RandStorageQuantity() uint64
- func ResourceUnits(_ testing.TB) types.Resources
- func Resources(t testing.TB) dtypes.ResourceUnits
- func ResourcesList(t testing.TB, startID uint32) dtypes.ResourceUnits
- type CertCache
- type CertificateOption
- func CertificateOptionCache(val CertCache) CertificateOption
- func CertificateOptionDomains(domains []string) CertificateOption
- func CertificateOptionMocks(val *certsmocks.QueryClient) CertificateOption
- func CertificateOptionNotAfter(tm time.Time) CertificateOption
- func CertificateOptionNotBefore(tm time.Time) CertificateOption
- type Config
- type Keyring
- type MockCometRPC
- func (m MockCometRPC) ABCIQueryWithOptions(_ context.Context, _ string, _ tmbytes.HexBytes, _ rpcclient.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)
- func (MockCometRPC) Akash(_ context.Context) (*arpcclient.Akash, error)
- func (MockCometRPC) BroadcastTxSync(context.Context, tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)
- type MockRPC
- type ModuleOption
- func AuthModule() ModuleOption
- func AuthzModule() ModuleOption
- func BankModule() ModuleOption
- func CircuitModule() ModuleOption
- func ConsensusModule() ModuleOption
- func DistributionModule() ModuleOption
- func EvidenceModule() ModuleOption
- func FeegrantModule() ModuleOption
- func GenutilModule() ModuleOption
- func GovModule() ModuleOption
- func GroupModule() ModuleOption
- func MintModule() ModuleOption
- func NFTModule() ModuleOption
- func OmitInitGenesis() ModuleOption
- func ParamsModule() ModuleOption
- func ProtocolPoolModule() ModuleOption
- func SlashingModule() ModuleOption
- func StakingModule() ModuleOption
- func TxModule() ModuleOption
- func VestingModule() ModuleOption
- func WithCustomBeginBlockersOrder(beginBlockOrder ...string) ModuleOption
- func WithCustomEndBlockersOrder(endBlockersOrder ...string) ModuleOption
- func WithCustomInitGenesisOrder(initGenesisOrder ...string) ModuleOption
- func WithCustomPreBlockersOrder(preBlockOrder ...string) ModuleOption
- type TestAccount
- type TestCertificate
- type UsablePorts
Constants ¶
const ( CoinDenom = "uakt" BechPrefix = "akash" )
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.Version
var DistributionAppConfig = NewAppConfig( AuthModule(), BankModule(), StakingModule(), TxModule(), ConsensusModule(), ParamsModule(), GenutilModule(), DistributionModule(), MintModule(), )
Functions ¶
func AccAddress ¶
func AccAddress(t testing.TB) types.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 ¶
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 ¶
func DeploymentGroup(t testing.TB, did dtypes.DeploymentID, gseq uint32) dtypesv1beta4.Group
DeploymentGroup generates a dtype.DepDeploymentGroup in state `GroupOpen` with a set of random required attributes
func DeploymentGroups ¶
func DeploymentGroups(t testing.TB, did dtypes.DeploymentID, gseq uint32) dtypesv1beta4.Groups
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 NewAppConfig ¶
func NewAppConfig(opts ...ModuleOption) depinject.Config
func PlacementRequirements ¶
func PlacementRequirements(t testing.TB) attr.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
func Resources ¶
func Resources(t testing.TB) dtypes.ResourceUnits
Resources produce an attribute list for populating a Group's 'Resources' fields.
func ResourcesList ¶
func ResourcesList(t testing.TB, startID uint32) dtypes.ResourceUnits
ResourcesList produces an attribute list for populating a Group's 'Resources' fields.
Types ¶
type CertificateOption ¶
type CertificateOption func(*certificateOption)
func CertificateOptionCache ¶
func CertificateOptionCache(val CertCache) CertificateOption
func CertificateOptionDomains ¶
func CertificateOptionDomains(domains []string) CertificateOption
func CertificateOptionMocks ¶
func CertificateOptionMocks(val *certsmocks.QueryClient) CertificateOption
func CertificateOptionNotAfter ¶
func CertificateOptionNotAfter(tm time.Time) CertificateOption
func CertificateOptionNotBefore ¶
func CertificateOptionNotBefore(tm time.Time) CertificateOption
type Config ¶
type Config struct {
ModuleConfigs map[string]*appv1alpha1.ModuleConfig
PreBlockersOrder []string
BeginBlockersOrder []string
EndBlockersOrder []string
InitGenesisOrder []string
// contains filtered or unexported fields
}
Config should never need to be instantiated manually and is solely used for ModuleOption.
type Keyring ¶
func NewTestKeyring ¶
type MockCometRPC ¶
type MockCometRPC struct {
rpcclientmock.Client
// contains filtered or unexported fields
}
func NewMockCometRPC ¶
func NewMockCometRPC(respQuery abci.ResponseQuery) MockCometRPC
NewMockCometRPC returns a mock TendermintRPC implementation. It is used for CLI testing.
func (MockCometRPC) ABCIQueryWithOptions ¶
func (m MockCometRPC) ABCIQueryWithOptions( _ context.Context, _ string, _ tmbytes.HexBytes, _ rpcclient.ABCIQueryOptions, ) (*coretypes.ResultABCIQuery, error)
func (MockCometRPC) Akash ¶
func (MockCometRPC) Akash(_ context.Context) (*arpcclient.Akash, error)
func (MockCometRPC) BroadcastTxSync ¶
func (MockCometRPC) BroadcastTxSync(context.Context, tmtypes.Tx) (*coretypes.ResultBroadcastTx, error)
type ModuleOption ¶
type ModuleOption func(config *Config)
func AuthModule ¶
func AuthModule() ModuleOption
func AuthzModule ¶
func AuthzModule() ModuleOption
func BankModule ¶
func BankModule() ModuleOption
func CircuitModule ¶
func CircuitModule() ModuleOption
func ConsensusModule ¶
func ConsensusModule() ModuleOption
func DistributionModule ¶
func DistributionModule() ModuleOption
func EvidenceModule ¶
func EvidenceModule() ModuleOption
func FeegrantModule ¶
func FeegrantModule() ModuleOption
func GenutilModule ¶
func GenutilModule() ModuleOption
func GovModule ¶
func GovModule() ModuleOption
func GroupModule ¶
func GroupModule() ModuleOption
func MintModule ¶
func MintModule() ModuleOption
func NFTModule ¶
func NFTModule() ModuleOption
func OmitInitGenesis ¶
func OmitInitGenesis() ModuleOption
func ParamsModule ¶
func ParamsModule() ModuleOption
func ProtocolPoolModule ¶
func ProtocolPoolModule() ModuleOption
func SlashingModule ¶
func SlashingModule() ModuleOption
func StakingModule ¶
func StakingModule() ModuleOption
func TxModule ¶
func TxModule() ModuleOption
func VestingModule ¶
func VestingModule() ModuleOption
func WithCustomBeginBlockersOrder ¶
func WithCustomBeginBlockersOrder(beginBlockOrder ...string) ModuleOption
func WithCustomEndBlockersOrder ¶
func WithCustomEndBlockersOrder(endBlockersOrder ...string) ModuleOption
func WithCustomInitGenesisOrder ¶
func WithCustomInitGenesisOrder(initGenesisOrder ...string) ModuleOption
func WithCustomPreBlockersOrder ¶
func WithCustomPreBlockersOrder(preBlockOrder ...string) ModuleOption
type TestAccount ¶
type TestAccount struct {
Name string
Address types.AccAddress
}
type TestCertificate ¶
type TestCertificate struct {
Cert []tls.Certificate
PubKey crypto.PublicKey
Serial big.Int
PEM struct {
Cert []byte
Priv []byte
Pub []byte
}
}
func Certificate ¶
func Certificate(t testing.TB, issuer sdk.Address, opts ...CertificateOption) TestCertificate
type UsablePorts ¶
type UsablePorts struct {
// contains filtered or unexported fields
}
UsablePorts yields a finite sequence of ephemeral TCP port numbers discovered at creation time. Safe for concurrent use; do not copy this struct after first use.
func GetUsablePorts ¶
func GetUsablePorts(count int) (*UsablePorts, error)
GetUsablePorts asks the kernel for unused TCP ports
func (*UsablePorts) MustGetPort ¶
func (p *UsablePorts) MustGetPort() int