Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupPath(t *testing.T, path string)
- func CleanupPathV2(path string)
- func PathOfTempFile(dirName string) (string, error)
- func RandomPort() int
- func SignalChan(interval, timeout time.Duration) <-chan struct{}
- func TimestampNow() time.Time
- func WaitUntil(interval, timeout time.Duration, f CheckCondition) error
- type CheckCondition
Constants ¶
const TestGasLimit uint64 = 20000
TestGasLimit represents the gas limit used for test actions
const TestGasPriceInt64 = 0
TestGasPriceInt64 represents the gas price for test actions in int64
Variables ¶
var ErrTimeout = errors.New("timed out")
ErrTimeout is returned when time is up
var TestGasPrice = big.NewInt(unit.Qev)
TestGasPrice represents the gas price for test actions in big int
Functions ¶
func CleanupPath ¶
CleanupPath detects the existence of test DB file and removes it if found
func CleanupPathV2 ¶ added in v1.6.4
func CleanupPathV2(path string)
CleanupPathV2 detects the existence of test DB file and removes it if found Todo: replace CleanupPath with CleanupPathV2 for compatibility
func PathOfTempFile ¶ added in v0.11.0
PathOfTempFile returns path of a new temporary file
func RandomPort ¶ added in v0.4.4
func RandomPort() int
RandomPort returns a random port number between 30000 and 50000
func SignalChan ¶
SignalChan returns a channel that will be written every interval until timeout
func TimestampNow ¶ added in v0.4.0
TimestampNow returns current time from new clock
func WaitUntil ¶
func WaitUntil(interval, timeout time.Duration, f CheckCondition) error
WaitUntil periodically checks whether the condition specified in CheckCondition function is satisfied If an error is returned, it either comes from CheckCondition function or time is up before the given condition is satisfied
Types ¶
type CheckCondition ¶
CheckCondition defines a func type that checks whether a certain condition is satisfied