tools

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: LGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InitPrivateKeyHex       = "0000000000000000000000000000000000000000000000000000000000000000"
	NumAccounts       int64 = 100000
	AccountsPerRound  int64 = 10000
	EthSigner               = ethtypes.HomesteadSigner{}
)
View Source
var (
	ErrRetTypeWrong = errors.New("type of returned value is neither LTable nor LTString")
)

Functions

func CloseLuaState

func CloseLuaState(l *lua.LState)

func CoinSetupTestBase

func CoinSetupTestBase(statedb *state.StateDB) (common.Hash, time.Duration)

CoinSetupTestBase just create 1 million accounts with 10000 balance without tx, it should be much faster

func CopyBytes

func CopyBytes(byts []byte) []byte

func DetermineExternalAddress

func DetermineExternalAddress(listener net.Listener, lAddrIP, lAddrPort string, skipUPNP bool) (string, error)

func ExecLuaWithParam

func ExecLuaWithParam(l *lua.LState, code string, entParams cvtypes.ParamUData) (cvtypes.ParamUData, error)

ExecLuaWithParam will not close lua.LState, so you should close it manually afterwards.

func ExpandPath

func ExpandPath(p string) string

func HashKeccak

func HashKeccak(data []byte) ([]byte, error)

func HomeDir

func HomeDir() string

func LuaSyntaxCheck

func LuaSyntaxCheck(code string) error

func NewLuaState

func NewLuaState() *lua.LState

func PbMarshal

func PbMarshal(msg proto.Message) []byte

func PbUnmarshal

func PbUnmarshal(data []byte, msg proto.Message) error

func PreparePrivateKeys

func PreparePrivateKeys(round int, num int64) []*ecdsa.PrivateKey

func ProtocolAndAddress

func ProtocolAndAddress(listenAddr string) (string, string)

func TxFromBytes

func TxFromBytes(bytes []byte, tx cvtypes.ICivilTx) error

TxFromBytes is just the reverse operation of TxToBytes

func TxHash

func TxHash(tx cvtypes.ICivilTx) ([]byte, error)

TxHash hashes ICivilTx

func TxSign

func TxSign(tx cvtypes.ICivilTx, p crypto.PrivKey) ([]byte, error)

TxSign now will also embed the pubkey of the signer, don't need filling pubkey manually

func TxToBytes

func TxToBytes(tx cvtypes.ICivilTx) ([]byte, error)

TxToBytes defines a universal way to serialize ICivilTx

func TxVerifySignature

func TxVerifySignature(tx cvtypes.ICivilTx) (bool, error)

TxVerifySignature verifies the signature carried by the ICivilTx

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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