common

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: BSD-3-Clause, BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToHex

func BytesToHex(data []byte) string

func CopyBytes

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

CopyBytes returns an exact copy of the provided bytes.

func HexToBytes

func HexToBytes(hex string) []byte

func HexToString

func HexToString(hex string) string

func IsHex

func IsHex(hex string) bool

func ToBytes

func ToBytes(data interface{}) ([]byte, error)

Types

type Address

type Address [addressLength]byte

Address ...

func NewAddress

func NewAddress(data []byte) (result Address)

func StringToAddress

func StringToAddress(s string) (addr Address)

func (*Address) String

func (addr *Address) String() string

type Block

type Block struct {
	Number          *big.Int `json:"number"`
	Hash            Hash     `json:"hash"`
	ParentHash      Hash     `json:"parentHash"`
	Nonce           Hash     `json:"nonce"`
	Sha3Uncles      Hash     `json:"sha3Uncles"`
	Bloom           Hash     `json:"logsBloom"`
	TransactionRoot Hash     `json:"transactionsRoot"`
	StateRoot       Hash     `json:"stateRoot"`
	Miner           Address  `json:"miner"`
	Difficulty      *big.Int `json:"difficulty"`
	TotalDifficulty *big.Int `json:"totalDifficulty"`
	ExtraData       Hash     `json:"extraData"`
	Size            *big.Int `json:"size"`
	GasLimit        *big.Int `json:"gasLimit"`
	GasUsed         *big.Int `json:"gasUsed"`
	Timestamp       *big.Int `json:"timestamp"`
	Transactions    []Hash   `json:"transactions"`
	Uncles          []Hash   `json:"uncles"`
}

Block ...

type Hash

type Hash [hashLength]byte

Hash ...

func NewHash

func NewHash(data []byte) (result Hash)

func StringToHash

func StringToHash(s string) (hash Hash)

func (*Hash) String

func (hash *Hash) String() string

type Log

type Log struct {
	LogIndex         uint64   `json:"logIndex"`
	BlockNumber      *big.Int `json:"blockNumber"`
	BlockHash        Hash     `json:"blockHash"`
	TransactionHash  Hash     `json:"transactionHash"`
	TransactionIndex uint64   `json:"transactionIndex"`
	Address          Address  `json:"address"`
	Data             []byte   `json:"data"`
	Topics           Topics   `json:"topics"`
}

Log ...

type SyncStatus

type SyncStatus struct {
	Result        bool
	StartingBlock *big.Int
	CurrentBlock  *big.Int
	HighestBlock  *big.Int
}

SyncStatus ...

type Topic

type Topic struct {
	Data []byte
}

type Topics

type Topics []Topic

type Transaction

type Transaction struct {
	Hash             Hash     `json:"hash"`
	Nonce            Hash     `json:"nonce"`
	BlockHash        Hash     `json:"blockHash"`
	BlockNumber      *big.Int `json:"blockNumber"`
	TransactionIndex uint64   `json:"transactionIndex"`
	From             Address  `json:"from"`
	To               Address  `json:"to"`
	Gas              *big.Int `json:"gas"`
	GasPrice         *big.Int `json:"gasprice"`
	Value            *big.Int `json:"value"`
	Data             []byte   `json:"input"`
}

Transaction ...

func (*Transaction) String

func (tx *Transaction) String() string

type TransactionReceipt

type TransactionReceipt struct {
	Hash              Hash     `json:"transactionHash"`
	TransactionIndex  uint64   `json:"transactionIndex"`
	BlockNumber       *big.Int `json:"blockNumber"`
	BlockHash         Hash     `json:"blockHash"`
	CumulativeGasUsed *big.Int `json:"cumulativeGasUsed"`
	GasUsed           *big.Int `json:"gasUsed"`
	ContractAddress   Address  `json:"contractAddress"`
	Logs              []Log    `json:"logs"`
}

TransactionReceipt ...

func (*TransactionReceipt) String

func (tx *TransactionReceipt) String() string

type TransactionRequest

type TransactionRequest struct {
	From     Address  `json:"from"`
	To       Address  `json:"to"`
	Gas      *big.Int `json:"gas"`
	GasPrice *big.Int `json:"gasprice"`
	Value    *big.Int `json:"value"`
	Data     []byte   `json:"data"`
}

TransactionRequest ...

func (*TransactionRequest) String

func (tx *TransactionRequest) String() string

type Transactions

type Transactions struct {
	// contains filtered or unexported fields
}

func NewTransactions

func NewTransactions(nonce uint64, to Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transactions

func (*Transactions) EncodeRLP

func (tx *Transactions) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder

Jump to

Keyboard shortcuts

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