testtool

package
v1.10.0-beta.20201225 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package testtool 测试用辅助函数

Index

Constants

View Source
const E18 = 1e18

E18 ethereum 1后面18个0

Variables

This section is empty.

Functions

func FailOnErr

func FailOnErr(t *testing.T, e error, msg string)

FailOnErr used in testing assert

func FailOnFlag

func FailOnFlag(t *testing.T, flag bool, params ...interface{})

FailOnFlag false时t.Fatal

func PrepareFunds4address

func PrepareFunds4address(t *testing.T, rpcHost, addr string, funds int64)

PrepareFunds4address 为addr准备一定量的eth,

func WaitSomething

func WaitSomething(t *testing.T, timeout time.Duration, fn func() error)

Types

type AddrInfo

type AddrInfo struct {
	PrivkHex, PubkHex, Address string
}

AddrInfo 私钥、公钥、地址

func GenAddr

func GenAddr() *AddrInfo

GenAddr 生成地址

func (*AddrInfo) ToAddress

func (ad *AddrInfo) ToAddress() common.Address

ToAddress .

func (*AddrInfo) ToECDSAKey

func (ad *AddrInfo) ToECDSAKey() *ecdsa.PrivateKey

ToECDSAKey .

Jump to

Keyboard shortcuts

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