types

package
v0.8.4-1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: LGPL-2.1-or-later Imports: 13 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 {
	// Preset Hash for mock
	HeaderHash       []byte
	ParentHeaderHash []byte

	Td *big.Int

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

func NewBlock added in v0.8.4

func NewBlock(parentHash []byte, coinbase []byte, root []byte, difficulty *big.Int, nonce []byte, extra string) *Block

func NewBlockWithHeader added in v0.8.4

func NewBlockWithHeader(header *Header) *Block

func (*Block) AddReceipt added in v0.8.4

func (self *Block) AddReceipt(receipt *Receipt)

func (*Block) AddTransaction added in v0.8.4

func (self *Block) AddTransaction(transaction *Transaction)

func (*Block) Bloom added in v0.8.4

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

func (*Block) Coinbase

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

func (*Block) DecodeRLP added in v0.8.4

func (self *Block) DecodeRLP(s *rlp.Stream) error

func (*Block) Difficulty

func (self *Block) Difficulty() *big.Int

Implement pow.Block

func (*Block) GasLimit

func (self *Block) GasLimit() *big.Int

func (*Block) GasUsed

func (self *Block) GasUsed() *big.Int

func (*Block) GetTransaction

func (self *Block) GetTransaction(i int) *Transaction

func (*Block) GetUncle added in v0.8.4

func (self *Block) GetUncle(i int) *Header

func (*Block) Hash

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

func (*Block) HashNoNonce

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

func (*Block) Header added in v0.8.4

func (self *Block) Header() *Header

func (*Block) N

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

func (*Block) Nonce

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

func (*Block) Number

func (self *Block) Number() *big.Int

Header accessors (add as you need them)

func (*Block) NumberU64 added in v0.8.4

func (self *Block) NumberU64() uint64

func (*Block) ParentHash added in v0.8.4

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

func (*Block) Receipts

func (self *Block) Receipts() Receipts

func (*Block) RlpData

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

func (*Block) RlpDataForStorage added in v0.8.4

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

func (*Block) Root

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

func (*Block) SetReceipts

func (self *Block) SetReceipts(receipts Receipts)

func (*Block) SetRoot added in v0.8.4

func (self *Block) SetRoot(root []byte)

func (*Block) SetTransactions

func (self *Block) SetTransactions(transactions Transactions)

func (*Block) SetUncles

func (self *Block) SetUncles(uncleHeaders []*Header)

func (*Block) Size

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

func (*Block) String

func (self *Block) String() string

func (*Block) Time

func (self *Block) Time() int64

func (*Block) Transaction added in v0.8.4

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

func (*Block) Transactions

func (self *Block) Transactions() Transactions

func (*Block) Uncles

func (self *Block) Uncles() []*Header

type BlockBy

type BlockBy func(b1, b2 *Block) bool

func (BlockBy) Sort

func (self BlockBy) Sort(blocks Blocks)

type BlockProcessor

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

type Blocks

type Blocks []*Block

type DerivableList

type DerivableList interface {
	Len() int
	GetRlp(i int) []byte
}
type Header struct {
	// Hash to the previous block
	ParentHash ethutil.Bytes
	// Uncles of this block
	UncleHash []byte
	// The coin base address
	Coinbase []byte
	// Block Trie state
	Root []byte
	// Tx sha
	TxHash []byte
	// Receipt sha
	ReceiptHash []byte
	// Bloom
	Bloom []byte
	// Difficulty for the current block
	Difficulty *big.Int
	// The block number
	Number *big.Int
	// Gas limit
	GasLimit *big.Int
	// Gas used
	GasUsed *big.Int
	// Creation time
	Time uint64
	// Extra data
	Extra string
	// Block Nonce for verification
	Nonce ethutil.Bytes
}

func (*Header) Hash added in v0.8.4

func (self *Header) Hash() []byte

func (*Header) HashNoNonce added in v0.8.4

func (self *Header) HashNoNonce() []byte

func (*Header) RlpData added in v0.8.4

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

func (*Header) String added in v0.8.4

func (self *Header) String() string

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 {
	AccountNonce uint64
	Price        *big.Int
	GasLimit     *big.Int
	Recipient    []byte
	Amount       *big.Int
	Payload      []byte
	V            uint64
	R, S         []byte
}

func NewContractCreationTx

func NewContractCreationTx(Amount, gasAmount, price *big.Int, data []byte) *Transaction

func NewTransactionFromAmount added in v0.8.4

func NewTransactionFromAmount(val *ethutil.Value) *Transaction

func NewTransactionFromBytes

func NewTransactionFromBytes(data []byte) *Transaction

func NewTransactionMessage

func NewTransactionMessage(to []byte, Amount, gasAmount, price *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) RlpValueDecode

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

func (*Transaction) SetNonce

func (self *Transaction) SetNonce(AccountNonce uint64)

func (*Transaction) Sign

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

func (*Transaction) SignECDSA added in v0.8.4

func (tx *Transaction) SignECDSA(key *ecdsa.PrivateKey) 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