testutil

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KeyPasswd = "0123456789"
	KeyAlgo   = "ed25519"
	KeyName   = "test"
)

Variables

This section is empty.

Functions

func Address added in v0.0.3

func Address(t *testing.T) []byte

func AfterThreadStart added in v0.0.7

func AfterThreadStart(t *testing.T) <-chan time.Time

func CloseDeployment added in v0.0.2

func CloseDeployment(t *testing.T, st state.State, app apptypes.Application, deployment *base.Bytes, key crypto.PrivKey)

func CloseFulfillment added in v0.0.4

func CloseFulfillment(t *testing.T, st state.State, app apptypes.Application, key crypto.PrivKey, fulfillment *types.Fulfillment)

func CloseLease added in v0.0.5

func CloseLease(t *testing.T, st state.State, app apptypes.Application, id types.LeaseID, key crypto.PrivKey)

func CreateAccount

func CreateAccount(t *testing.T, state state.State) (*types.Account, crypto.PrivKey)

func CreateDeployment

func CreateDeployment(t *testing.T, st state.State, app apptypes.Application, account *types.Account, key crypto.PrivKey, nonce uint64) (*types.Deployment, *types.DeploymentGroups)

func CreateFulfillment

func CreateFulfillment(t *testing.T, st state.State, app apptypes.Application, provider base.Bytes, key crypto.PrivKey, deployment base.Bytes, group, order, price uint64) *types.Fulfillment

func CreateLease

func CreateLease(t *testing.T, st state.State, app apptypes.Application, provider base.Bytes, key crypto.PrivKey, deployment base.Bytes, group, order, price uint64) *types.Lease

func CreateOrder

func CreateOrder(t *testing.T, st state.State, app apptypes.Application, account *types.Account, key crypto.PrivKey, deploymentAddress base.Bytes, groupSeq, orderSeq uint64) *types.Order

func CreateProvider

func CreateProvider(t *testing.T, st state.State, app apptypes.Application, account *types.Account, key crypto.PrivKey, nonce uint64) *types.Provider

func Deployment

func Deployment(tenant base.Bytes, nonce uint64, version ...[]byte) *types.Deployment

func DeploymentAddress added in v0.0.3

func DeploymentAddress(t *testing.T) []byte

func DeploymentGroup added in v0.3.0

func DeploymentGroup(daddr []byte, nonce uint64) *types.DeploymentGroup

func DeploymentGroups added in v0.0.2

func DeploymentGroups(deployment base.Bytes, nonce uint64) *types.DeploymentGroups

func Fulfillment

func Fulfillment(provider base.Bytes, deplyment base.Bytes, group, order uint64, price uint64) *types.Fulfillment

func HexAddress added in v0.0.3

func HexAddress(t *testing.T) string

func HexDeploymentAddress added in v0.0.3

func HexDeploymentAddress(t *testing.T) string

func KeyManager

func KeyManager(t *testing.T) keys.Keybase

func Lease

func Lease(provider base.Bytes, deplyment base.Bytes, group, order uint64, price uint64) *types.Lease

func Logger

func Logger() log.Logger

func ManifestGroupsForDeploymentGroups added in v0.3.0

func ManifestGroupsForDeploymentGroups(t *testing.T, dgroups []*types.DeploymentGroup) []*types.ManifestGroup

func NewApp

func NewApp(t *testing.T, gen *types.Genesis) tmtypes.Application

func NewNamedKey

func NewNamedKey(t *testing.T) (keys.Info, keys.Keybase)

func NewState

func NewState(t *testing.T, gen *types.Genesis) (state.CommitState, state.CacheState)

NewState used only for testing

func Order

func Order(deploymentAddress base.Bytes, groupSeq, orderSeq uint64) *types.Order

func PrivateKey

func PrivateKey(t *testing.T) crypto.PrivKey

func PrivateKeySigner

func PrivateKeySigner(t *testing.T) (txutil.Signer, crypto.PrivKey)

func Provider

func Provider(account base.Bytes, nonce uint64) *types.Provider

func ProviderTx

func ProviderTx(account *types.Account, key crypto.PrivKey, nonce uint64) *types.Tx

func PublicKey added in v0.0.3

func PublicKey(t *testing.T) crypto.PubKey

func ResourceGroup added in v0.3.0

func ResourceGroup() types.ResourceGroup

func ResourceUnit added in v0.3.0

func ResourceUnit() types.ResourceUnit

func Shrug added in v0.0.3

func Shrug(t *testing.T, issue int)

func Signer added in v0.0.6

func Signer(t *testing.T, kmgr keys.Keybase) txutil.Signer

func SleepForThreadStart

func SleepForThreadStart(t *testing.T)

func TMConfig

func TMConfig(t *testing.T, basedir string) *tmconfig.Config

func TempDir

func TempDir(t *testing.T) string

func UpdateDeployment added in v0.3.0

func UpdateDeployment(t *testing.T,
	st state.State,
	app apptypes.Application,
	key crypto.PrivKey,
	nonce uint64,
	daddr []byte) *types.TxUpdateDeployment

func WaitReady added in v0.3.0

func WaitReady(t *testing.T, ch <-chan struct{})

func WithAkashDir added in v0.0.3

func WithAkashDir(t *testing.T, fn func(string))

func WithTempDir added in v0.0.3

func WithTempDir(t *testing.T, fn func(string))

func WithTempDirEnv added in v0.0.3

func WithTempDirEnv(t *testing.T, key string, fn func(string))

Types

type MockGRPCStreamServer added in v0.2.2

type MockGRPCStreamServer struct{}

func (MockGRPCStreamServer) Context added in v0.2.2

func (s MockGRPCStreamServer) Context() context.Context

func (MockGRPCStreamServer) RecvMsg added in v0.2.2

func (s MockGRPCStreamServer) RecvMsg(m interface{}) error

func (MockGRPCStreamServer) SendHeader added in v0.2.2

func (s MockGRPCStreamServer) SendHeader(metadata.MD) error

func (MockGRPCStreamServer) SendMsg added in v0.2.2

func (s MockGRPCStreamServer) SendMsg(m interface{}) error

func (MockGRPCStreamServer) SetHeader added in v0.2.2

func (s MockGRPCStreamServer) SetHeader(metadata.MD) error

func (MockGRPCStreamServer) SetTrailer added in v0.2.2

func (s MockGRPCStreamServer) SetTrailer(metadata.MD)

type ReadCloser added in v0.2.2

type ReadCloser struct {
	io.Reader
}

func (ReadCloser) Close added in v0.2.2

func (r ReadCloser) Close() error

Jump to

Keyboard shortcuts

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