common

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

View Source
const (
	InvalidInt  int    = 255
	BlankString string = ""
)

Variables

This section is empty.

Functions

func CopyBytes

func CopyBytes(b []byte) (copiedBytes []byte)

func HashAlg added in v1.0.0

func HashAlg() hash.Hash

func HeaderHash

func HeaderHash(block *types.Block) types.Hash

func NewTransaction

func NewTransaction(nonce uint64, to types.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, from types.Address) *types.Transaction

func SystemContractType added in v1.0.0

func SystemContractType(contractType string) types.ContractType

func TxHash

func TxHash(tx *types.Transaction) types.Hash

Hash hashes the RLP encoding of tx. It uniquely identifies the transaction.

Types

type MsgType

type MsgType uint8
const (
	MsgNull               MsgType = iota // meaningless msg type
	MsgBlockCommitSuccess                //  block commit success
	MsgBlockCommitFailed                 //  block commit failed
	MsgBlockVerifyFailed                 //  block verify failed
	MsgNodeServiceStopped                //  stop node service
	MsgRoundRunFailed                    //  round run failed with some reasons
	MsgToConsensusFailed                 //  failed to consensus
	MsgChangeMaster                      //  change master
	MsgOnline                            //  node online
	MsgBlockWithoutTx                    // block without transaction
	MsgWaitTimeOut
)

type NodeType added in v1.0.0

type NodeType int
const (
	UnknownNode   NodeType = iota // UnknownNode --> 0, Unknown node type
	ConsensusNode                 // ConsensusNode --> 1, Consensus function node
	FullNode                      // FullNode --> 2, Full node
	LightNode                     // LightNode --> 3, Light node with simply function
	MaxNodeType                   // MaxNodeType is the boundary of node type
)

Jump to

Keyboard shortcuts

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