types

package
v0.7.10-broken Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2014 License: LGPL-2.1-or-later Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BloomLookup

func BloomLookup(bin, topic []byte) bool

func CreateBloom

func CreateBloom(receipts Receipts) []byte

func DeriveSha

func DeriveSha(list DerivableList) []byte

func IsContractAddr

func IsContractAddr(addr []byte) bool

func LogsBloom

func LogsBloom(logs state.Logs) *big.Int

func Number

func Number(b1, b2 *Block) bool

Types

type Block

type Block struct {
	// Hash to the previous block
	PrevHash ethutil.Bytes
	// Uncles of this block
	Uncles   Blocks
	UncleSha []byte
	// The coin base address
	Coinbase []byte

	// Difficulty for the current block
	Difficulty *big.Int
	// Creation time
	Time int64
	// The block number
	Number *big.Int
	// Gas limit
	GasLimit *big.Int
	// Gas used
	GasUsed *big.Int
	// Extra data
	Extra string
	// Block Nonce for verification
	Nonce ethutil.Bytes

	TxSha, ReceiptSha []byte
	LogsBloom         []byte

	Reward *big.Int
	// contains filtered or unexported fields
}

func CreateBlock

func CreateBlock(root interface{},
	prevHash []byte,
	base []byte,
	Difficulty *big.Int,
	Nonce []byte,
	extra string) *Block

func NewBlockFromBytes

func NewBlockFromBytes(raw []byte) *Block

func NewBlockFromRlpValue

func NewBlockFromRlpValue(rlpValue *ethutil.Value) *Block

New block takes a raw encoded string

func NewUncleBlockFromValue

func NewUncleBlockFromValue(header *ethutil.Value) *Block

func (*Block) BlockInfo

func (block *Block) BlockInfo() BlockInfo

func (*Block) CalcGasLimit

func (block *Block) CalcGasLimit(parent *Block) *big.Int

func (*Block) Diff

func (block *Block) Diff() *big.Int

func (*Block) GetTransaction

func (self *Block) GetTransaction(hash []byte) *Transaction

func (*Block) Hash

func (block *Block) Hash() ethutil.Bytes

Returns a hash of the block

func (*Block) HashNoNonce

func (block *Block) HashNoNonce() []byte

func (*Block) N

func (self *Block) N() []byte

Implement pow.Block

func (*Block) Receipts

func (self *Block) Receipts() []*Receipt

func (*Block) RlpData

func (self *Block) RlpData() interface{}

Implement RlpEncodable

func (*Block) RlpDecode

func (block *Block) RlpDecode(data []byte)

func (*Block) RlpEncode

func (block *Block) RlpEncode() []byte

func (*Block) RlpValueDecode

func (block *Block) RlpValueDecode(decoder *ethutil.Value)

func (*Block) Root

func (block *Block) Root() interface{}

func (*Block) SetReceipts

func (self *Block) SetReceipts(receipts Receipts)

func (*Block) SetTransactions

func (self *Block) SetTransactions(txs Transactions)

func (*Block) SetUncles

func (block *Block) SetUncles(uncles []*Block)

func (*Block) Size

func (self *Block) Size() ethutil.StorageSize

func (*Block) State

func (block *Block) State() *state.StateDB

func (*Block) String

func (block *Block) String() string

func (*Block) Sync

func (block *Block) Sync()

Sync the block's state and contract respectively

func (*Block) Transactions

func (block *Block) Transactions() Transactions

func (*Block) Trie

func (block *Block) Trie() *trie.Trie

func (*Block) Undo

func (block *Block) Undo()

func (*Block) Value

func (block *Block) Value() *ethutil.Value

type BlockBy

type BlockBy func(b1, b2 *Block) bool

func (BlockBy) Sort

func (self BlockBy) Sort(blocks Blocks)

type BlockInfo

type BlockInfo struct {
	Number uint64
	Hash   []byte
	Parent []byte
	TD     *big.Int
}

func (*BlockInfo) RlpDecode

func (bi *BlockInfo) RlpDecode(data []byte)

func (*BlockInfo) RlpEncode

func (bi *BlockInfo) RlpEncode() []byte

type BlockProcessor

type BlockProcessor interface {
	Process(*Block) (*big.Int, state.Messages, error)
}

type Blocks

type Blocks []*Block

func (Blocks) AsSet

func (self Blocks) AsSet() ethutil.UniqueSet

type Broadcaster

type Broadcaster interface {
	Broadcast(wire.MsgType, []interface{})
}

type DerivableList

type DerivableList interface {
	Len() int
	GetRlp(i int) []byte
}

type Receipt

type Receipt struct {
	PostState         []byte
	CumulativeGasUsed *big.Int
	Bloom             []byte
	// contains filtered or unexported fields
}

func NewReceipt

func NewReceipt(root []byte, cumalativeGasUsed *big.Int) *Receipt

func NewRecieptFromValue

func NewRecieptFromValue(val *ethutil.Value) *Receipt

func (*Receipt) Cmp

func (self *Receipt) Cmp(other *Receipt) bool

func (*Receipt) RlpData

func (self *Receipt) RlpData() interface{}

func (*Receipt) RlpEncode

func (self *Receipt) RlpEncode() []byte

func (*Receipt) RlpValueDecode

func (self *Receipt) RlpValueDecode(decoder *ethutil.Value)

func (*Receipt) SetLogs

func (self *Receipt) SetLogs(logs state.Logs)

func (*Receipt) String

func (self *Receipt) String() string

type Receipts

type Receipts []*Receipt

func (Receipts) GetRlp

func (self Receipts) GetRlp(i int) []byte

func (Receipts) Len

func (self Receipts) Len() int

func (Receipts) RlpData

func (self Receipts) RlpData() interface{}

func (Receipts) RlpEncode

func (self Receipts) RlpEncode() []byte

type Transaction

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

func NewContractCreationTx

func NewContractCreationTx(value, gas, gasPrice *big.Int, script []byte) *Transaction

func NewTransactionFromBytes

func NewTransactionFromBytes(data []byte) *Transaction

func NewTransactionFromValue

func NewTransactionFromValue(val *ethutil.Value) *Transaction

func NewTransactionMessage

func NewTransactionMessage(to []byte, value, gas, gasPrice *big.Int, data []byte) *Transaction

func (*Transaction) Curve

func (tx *Transaction) Curve() (v byte, r []byte, s []byte)

func (*Transaction) Data

func (self *Transaction) Data() []byte

func (*Transaction) From

func (self *Transaction) From() []byte

func (*Transaction) Gas

func (self *Transaction) Gas() *big.Int

func (*Transaction) GasPrice

func (self *Transaction) GasPrice() *big.Int

func (*Transaction) Hash

func (tx *Transaction) Hash() []byte

func (*Transaction) Nonce

func (self *Transaction) Nonce() uint64

func (*Transaction) PublicKey

func (tx *Transaction) PublicKey() []byte

func (*Transaction) RlpData

func (tx *Transaction) RlpData() interface{}

func (*Transaction) RlpDecode

func (tx *Transaction) RlpDecode(data []byte)

func (*Transaction) RlpEncode

func (tx *Transaction) RlpEncode() []byte

func (*Transaction) RlpValue

func (tx *Transaction) RlpValue() *ethutil.Value

func (*Transaction) RlpValueDecode

func (tx *Transaction) RlpValueDecode(decoder *ethutil.Value)

func (*Transaction) Sender

func (tx *Transaction) Sender() []byte

func (*Transaction) SetNonce

func (self *Transaction) SetNonce(nonce uint64)

func (*Transaction) Sign

func (tx *Transaction) Sign(privk []byte) error

func (*Transaction) Signature

func (tx *Transaction) Signature(key []byte) []byte

func (*Transaction) String

func (tx *Transaction) String() string

func (*Transaction) To

func (self *Transaction) To() []byte

func (*Transaction) Value

func (self *Transaction) Value() *big.Int

type Transactions

type Transactions []*Transaction

Transaction slice type for basic sorting

func (Transactions) GetRlp

func (s Transactions) GetRlp(i int) []byte

func (Transactions) Len

func (s Transactions) Len() int

func (Transactions) RlpData

func (self Transactions) RlpData() interface{}

func (Transactions) Swap

func (s Transactions) Swap(i, j int)

type TxByNonce

type TxByNonce struct{ Transactions }

func (TxByNonce) Less

func (s TxByNonce) Less(i, j int) bool

Jump to

Keyboard shortcuts

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