Documentation
¶
Index ¶
- Constants
- Variables
- func BalanceFor(accAddr string, peerAddr string) uint64
- func ChainHeightFor(peerAddr string) (int, error)
- func CircuAccounts() int
- func CircuRepeatRandom() bool
- func CircuRepeatTxTimes() int
- func CircuUnitAccounts() int
- func Closing(quitCh <-chan os.Signal) bool
- func CollAccounts() int
- func CollUnitAccounts() int
- func GenTestAddr(count int) []string
- func GetBoolCfgVal(def interface{}, keys ...string) (bool, error)
- func GetBoolSpecCfgVal(cfgData CfgData, def interface{}, keys ...string) (bool, error)
- func GetCfgVal(def interface{}, keys ...string) (interface{}, error)
- func GetFloatArrayCfgVal(def interface{}, keys ...string) ([]float64, error)
- func GetFloatArraySpecCfgVal(cfgData CfgData, def interface{}, keys ...string) ([]float64, error)
- func GetFloatCfgVal(def interface{}, keys ...string) (float64, error)
- func GetFloatSpecCfgVal(cfgData CfgData, def interface{}, keys ...string) (float64, error)
- func GetIniKV(iniBuf, key string) string
- func GetIntArrayCfgVal(def interface{}, keys ...string) ([]int, error)
- func GetIntArraySpecCfgVal(cfgData CfgData, def interface{}, keys ...string) ([]int, error)
- func GetIntCfgVal(def interface{}, keys ...string) (int, error)
- func GetIntSpecCfgVal(cfgData CfgData, def interface{}, keys ...string) (int, error)
- func GetSpecCfgVal(cfgData CfgData, def interface{}, keys ...string) (v interface{}, err error)
- func GetStrArrayCfgVal(def interface{}, keys ...string) ([]string, error)
- func GetStrArraySpecCfgVal(cfgData CfgData, def interface{}, keys ...string) ([]string, error)
- func GetStringCfgVal(def interface{}, keys ...string) (string, error)
- func GetStringSpecCfgVal(cfgData CfgData, def interface{}, keys ...string) (string, error)
- func InitConf(cfgFile string) error
- func LoadConf() error
- func LoadJSONFromFile(fileName string, result interface{}) error
- func MinerAccounts(keyFiles ...string) ([]string, []*acc.Account)
- func MinerAddrs() []string
- func ParseIPlist(fileName string) ([]string, error)
- func PeerAddrs() []string
- func PrepareEnv(count int) error
- func RemoveKeystoreFiles(addrs ...string)
- func SplitAddrAccounts() int
- func SplitAddrRepeatRandom() bool
- func SplitAddrRepeatTxTimes() int
- func SplitAddrTestEnable() bool
- func SplitAddrUnitAccounts() int
- func StartDockerNodes() error
- func StartLocalNodes(peerCount int) ([]*os.Process, error)
- func StartProcess(args ...string) (*os.Process, error)
- func StopLocalNodes(processes ...*os.Process) error
- func StopNodes() error
- func TearDown(count int) error
- func TickerDurationTxs() time.Duration
- func TimesToUpdateAddrs() int
- func TokenAccounts() int
- func TokenBalanceFor(addr string, tokenHash string, tokenIndex uint32, peerAddr string) uint64
- func TokenRepeatRandom() bool
- func TokenRepeatTxTimes() int
- func TokenTestEnable() bool
- func TokenUnitAccounts() int
- func TryRecordError(err error) bool
- func TxTestEnable() bool
- func UnlockAccount(addr string) *acc.Account
- func WaitAllNodesHeightHigher(addrs []string, h int, timeout time.Duration) error
- func WaitBalanceEnough(addr string, amount uint64, checkPeer string, timeout time.Duration) (uint64, error)
- func WaitBalanceEqual(addr string, amount uint64, checkPeer string, timeout time.Duration) (uint64, error)
- func WaitOneAddrBalanceEnough(addrs []string, amount uint64, checkPeer string, timeout time.Duration) (string, uint64, error)
- func WaitTokenBalanceEnough(addr string, amount uint64, thash string, idx uint32, checkPeer string, ...) (uint64, error)
- func WaitTokenBalanceEqualTo(addr string, amount uint64, thash string, idx uint32, checkPeer string, ...) error
- type CfgData
Constants ¶
const ( // RPCTimeout defines rpc timeout RPCTimeout = 10 * time.Second // RPCInterval defines rpc query interval RPCInterval = 300 * time.Millisecond )
Variables ¶
var ( // NewNodes flag indicates to need to start nodes NewNodes = flag.Bool("nodes", true, "need to start nodes?") // EnableDocker flag indicates to need start docker EnableDocker = flag.Bool("docker", false, "test in docker containers?") // LocalConf defines local test devconfig LocalConf = struct { ConfDir, WorkDir, KeyDir string }{"./.devconfig/", "./.devconfig/", "./.devconfig/keyfile/"} // DockerConf defines docker test devconfig DockerConf = struct { ConfDir, WorkDir, KeyDir string }{"../docker/.devconfig/", "../docker/.devconfig/", "../docker/.devconfig/keyfile/"} )
var ( // ErrItems record functional errors during integration tests ErrItems = make([]error, 0, maxErrItems) )
Functions ¶
func BalanceFor ¶
BalanceFor get balance of accAddr
func ChainHeightFor ¶
ChainHeightFor get chain height of peer's chain
func CircuRepeatTxTimes ¶
func CircuRepeatTxTimes() int
CircuRepeatTxTimes return circuRepeatTxTimes
func GetBoolCfgVal ¶
GetBoolCfgVal get bool value
func GetBoolSpecCfgVal ¶
GetBoolSpecCfgVal get bool value
func GetFloatArrayCfgVal ¶
GetFloatArrayCfgVal get float array value
func GetFloatArraySpecCfgVal ¶
GetFloatArraySpecCfgVal get float array value
func GetFloatCfgVal ¶
GetFloatCfgVal get float value
func GetFloatSpecCfgVal ¶
GetFloatSpecCfgVal get float value
func GetIntArrayCfgVal ¶
GetIntArrayCfgVal get int array value
func GetIntArraySpecCfgVal ¶
GetIntArraySpecCfgVal get int array value
func GetIntCfgVal ¶
GetIntCfgVal get int config value
func GetIntSpecCfgVal ¶
GetIntSpecCfgVal get int config vlaue
func GetSpecCfgVal ¶
GetSpecCfgVal get special cfg value from param cfgdata
func GetStrArrayCfgVal ¶
GetStrArrayCfgVal get string array value
func GetStrArraySpecCfgVal ¶
GetStrArraySpecCfgVal get string array value
func GetStringCfgVal ¶
GetStringCfgVal get string cfg value
func GetStringSpecCfgVal ¶
GetStringSpecCfgVal get string cfg value
func LoadJSONFromFile ¶
LoadJSONFromFile load json from file to result
func MinerAccounts ¶
MinerAccounts get miners' accounts
func ParseIPlist ¶
ParseIPlist parse ip list from json file
func PeerAddrs ¶
func PeerAddrs() []string
PeerAddrs gets execute transactions peers addresses from config file
func RemoveKeystoreFiles ¶
func RemoveKeystoreFiles(addrs ...string)
RemoveKeystoreFiles removes key store files
func SplitAddrRepeatRandom ¶
func SplitAddrRepeatRandom() bool
SplitAddrRepeatRandom return splitAddrRepeatRandom
func SplitAddrRepeatTxTimes ¶
func SplitAddrRepeatTxTimes() int
SplitAddrRepeatTxTimes return splitAddrRepeatTxTimes
func SplitAddrTestEnable ¶
func SplitAddrTestEnable() bool
SplitAddrTestEnable return splitAddrTestEnable
func SplitAddrUnitAccounts ¶
func SplitAddrUnitAccounts() int
SplitAddrUnitAccounts return splitAddrUnitAccounts
func StartLocalNodes ¶
StartLocalNodes start local nodes
func StartProcess ¶
StartProcess starts a process with args and default process attributions
func StopLocalNodes ¶
StopLocalNodes stop local nodes
func TickerDurationTxs ¶
TickerDurationTxs get ticker duration for calc tx count
func TimesToUpdateAddrs ¶
func TimesToUpdateAddrs() int
TimesToUpdateAddrs return timesToUpdateAddrs
func TokenBalanceFor ¶
TokenBalanceFor get token balance of addr
func TokenRepeatTxTimes ¶
func TokenRepeatTxTimes() int
TokenRepeatTxTimes return tokenRepeatTxTimes
func TryRecordError ¶
TryRecordError try to record error during integration test
func UnlockAccount ¶
UnlockAccount defines unlock account
func WaitAllNodesHeightHigher ¶
WaitAllNodesHeightHigher wait all nodes' height is higher than h
func WaitBalanceEnough ¶
func WaitBalanceEnough(addr string, amount uint64, checkPeer string, timeout time.Duration) (uint64, error)
WaitBalanceEnough wait balance of addr is more than amount
func WaitBalanceEqual ¶
func WaitBalanceEqual(addr string, amount uint64, checkPeer string, timeout time.Duration) (uint64, error)
WaitBalanceEqual wait balance of addr is more than amount
func WaitOneAddrBalanceEnough ¶
func WaitOneAddrBalanceEnough(addrs []string, amount uint64, checkPeer string, timeout time.Duration) (string, uint64, error)
WaitOneAddrBalanceEnough wait one addr's balance more than amount
Types ¶
type CfgData ¶
type CfgData map[string]*json.RawMessage
CfgData define config data responding conf.json
func InitSpecConf ¶
InitSpecConf inits config and return CfgData variable