testutil

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0, MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownTime = time.Unix(1601378000, 0).UTC()

Functions

func DatabaseAvailable

func DatabaseAvailable() bool

DatabaseAvailable reports whether a database is available for testing

func DatabaseOptions added in v0.3.0

func DatabaseOptions() string

Database returns the connection string for connecting to the test database

func FakeBlockHeader added in v0.5.0

func FakeBlockHeader(t testing.TB, height int64, stateRoot cid.Cid) *types.BlockHeader

func FakeTipset added in v0.5.0

func FakeTipset(t testing.TB) *types.TipSet

func NewMockClock

func NewMockClock() *clock.Mock

func RandomCid

func RandomCid() cid.Cid

func WaitForExclusiveDatabase

func WaitForExclusiveDatabase(ctx context.Context, tb testing.TB) (*pg.DB, func() error, error)

WaitForExclusiveDatabase waits for exclusive access to the test database until the context is done or the exclusive access is granted. It returns a cleanup function that should be called to close the database connection.

func WaitForExclusiveDatabaseLock

func WaitForExclusiveDatabaseLock(ctx context.Context, db *pg.DB) (func() error, error)

WaitForExclusiveDatabaseLock waits for a an exclusive lock on the test database until the context is done or the exclusive access is granted. It returns a cleanup function that should be called to release the exclusive lock. In any case the lock will be automatically released when the database session ends.

Types

type APIOpener added in v0.3.0

type APIOpener struct {
	// contains filtered or unexported fields
}

func NewAPIOpener added in v0.3.0

func NewAPIOpener(node *itestkit.TestFullNode) *APIOpener

func (*APIOpener) Daemonized added in v0.7.5

func (o *APIOpener) Daemonized() bool

func (*APIOpener) Open added in v0.3.0

func (o *APIOpener) Open(ctx context.Context) (lens.API, lens.APICloser, error)

type APIWrapper added in v0.3.0

type APIWrapper struct {
	*itestkit.TestFullNode
	// contains filtered or unexported fields
}

func (*APIWrapper) ChainGetTipSetAfterHeight added in v0.7.7

func (aw *APIWrapper) ChainGetTipSetAfterHeight(ctx context.Context, epoch abi.ChainEpoch, key types.TipSetKey) (*types.TipSet, error)

func (*APIWrapper) Context added in v0.3.0

func (aw *APIWrapper) Context() context.Context

func (*APIWrapper) Get added in v0.3.0

func (aw *APIWrapper) Get(ctx context.Context, c cid.Cid, out interface{}) error

func (*APIWrapper) GetExecutedAndBlockMessagesForTipset added in v0.6.3

func (aw *APIWrapper) GetExecutedAndBlockMessagesForTipset(ctx context.Context, ts, pts *types.TipSet) (*lens.TipSetMessages, error)

func (*APIWrapper) GetMessageExecutionsForTipSet added in v0.7.5

func (aw *APIWrapper) GetMessageExecutionsForTipSet(ctx context.Context, ts, pts *types.TipSet) ([]*lens.MessageExecution, error)

func (*APIWrapper) Put added in v0.3.0

func (aw *APIWrapper) Put(ctx context.Context, v interface{}) (cid.Cid, error)

func (*APIWrapper) StateGetReceipt added in v0.6.2

func (aw *APIWrapper) StateGetReceipt(ctx context.Context, msg cid.Cid, from types.TipSetKey) (*types.MessageReceipt, error)

func (*APIWrapper) Store added in v0.3.0

func (aw *APIWrapper) Store() adt.Store

Jump to

Keyboard shortcuts

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