Documentation ¶
Overview ¶
Package types contains data types related to truechain consensus.
Index ¶
- Constants
- Variables
- func BloomLookup(bin Bloom, topic bytesBacked) bool
- func CalcSignHash(signs []*PbftSign) common.Hash
- func CalcUncleHash(uncles []*Header) common.Hash
- func DeriveSha(list DerivableList) common.Hash
- func FruitNumber(b1, b2 *SnailBlock) bool
- func LogsBloom(logs []*Log) *big.Int
- func Number(b1, b2 *Block) bool
- func Payer(signer Signer, tx *Transaction) (common.Address, error)
- func RlpHash(x interface{}) (h common.Hash)
- func Sender(signer Signer, tx *Transaction) (common.Address, error)
- func SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error)
- func SnailNumber(b1, b2 *SnailBlock) bool
- type Block
- func (b *Block) AppendSign(sign *PbftSign)
- func (b *Block) AppendSigns(signs []*PbftSign)
- func (b *Block) Bloom() Bloom
- func (b *Block) Body() *Body
- func (b *Block) Coinbase() common.Address
- func (b *Block) CommitteeHash() common.Hash
- func (b *Block) DecodeRLP(s *rlp.Stream) error
- func (b *Block) EncodeRLP(w io.Writer) error
- func (b *Block) Extra() []byte
- func (b *Block) GasLimit() uint64
- func (b *Block) GasUsed() uint64
- func (b *Block) GetLeaderSign() *PbftSign
- func (b *Block) Hash() common.Hash
- func (b *Block) Header() *Header
- func (b *Block) IsAward() bool
- func (b *Block) IsProposal() bool
- func (b *Block) IsSwitch() bool
- func (b *Block) Number() *big.Int
- func (b *Block) NumberU64() uint64
- func (b *Block) ParentHash() common.Hash
- func (b *Block) Proposer() common.Address
- func (b *Block) ReceiptHash() common.Hash
- func (b *Block) Root() common.Hash
- func (b *Block) SetSign(signs []*PbftSign)
- func (b *Block) SignedHash() common.Hash
- func (b *Block) Signs() []*PbftSign
- func (b *Block) Size() common.StorageSize
- func (b *Block) SnailHash() common.Hash
- func (b *Block) SnailNumber() *big.Int
- func (b *Block) SwitchInfos() []*CommitteeMember
- func (b *Block) Time() *big.Int
- func (b *Block) Transaction(hash common.Hash) *Transaction
- func (b *Block) Transactions() Transactions
- func (b *Block) TxHash() common.Hash
- func (b *Block) UncleHash() common.Hash
- func (b *Block) WithBody(transactions []*Transaction, signs []*PbftSign, infos []*CommitteeMember) *Block
- func (b *Block) WithSeal(header *Header) *Block
- type BlockBy
- type BlockNonce
- type BlockReward
- type Blocks
- type Bloom
- func (b *Bloom) Add(d *big.Int)
- func (b Bloom) Big() *big.Int
- func (b Bloom) Bytes() []byte
- func (b Bloom) MarshalText() ([]byte, error)
- func (b *Bloom) SetBytes(d []byte)
- func (b Bloom) Test(test *big.Int) bool
- func (b Bloom) TestBytes(test []byte) bool
- func (b *Bloom) UnmarshalText(input []byte) error
- type Body
- type CommitteeInfo
- type CommitteeMember
- type CommitteeMembers
- type CommitteeNode
- type CommitteeNodeTag
- type DerivableList
- type ElectionCommittee
- type ElectionEvent
- type EncryptCommitteeNode
- type EncryptNodeMessage
- func (c *EncryptNodeMessage) DecodeRLP(s *rlp.Stream) error
- func (c *EncryptNodeMessage) EncodeRLP(w io.Writer) error
- func (c *EncryptNodeMessage) Hash() common.Hash
- func (c *EncryptNodeMessage) HashWithoutSign() common.Hash
- func (c *EncryptNodeMessage) Size() common.StorageSize
- func (c *EncryptNodeMessage) String(str string)
- type FastChainEvent
- type FastChainHeadEvent
- type FastChainSideEvent
- type FruitEvent
- type Fruits
- type FruitsHeaders
- type GenesisAccount
- type GenesisAlloc
- type GenesisMismatchError
- type Header
- type Log
- type LogForStorage
- type Message
- func (m Message) CheckNonce() bool
- func (m Message) Data() []byte
- func (m Message) Fee() *big.Int
- func (m Message) From() common.Address
- func (m Message) Gas() uint64
- func (m Message) GasPrice() *big.Int
- func (m Message) Nonce() uint64
- func (m Message) Payment() common.Address
- func (m Message) To() *common.Address
- func (m Message) Value() *big.Int
- type NewFastBlocksEvent
- type NewFruitsEvent
- type NewMinedBlockEvent
- type NewMinedFruitEvent
- type NewTxsEvent
- type NodeInfoEvent
- type PbftAgentProxy
- type PbftServerProxy
- type PbftSign
- type PbftSignEvent
- type PbftSigns
- type PendingLogsEvent
- type PendingStateEvent
- type RawTransaction
- type Receipt
- type ReceiptForStorage
- type Receipts
- type RemovedLogsEvent
- type Sign
- type Signer
- type SnailBlock
- func (b *SnailBlock) BlockDifficulty() *big.Int
- func (b *SnailBlock) Body() *SnailBody
- func (b *SnailBlock) Coinbase() common.Address
- func (b *SnailBlock) DecodeRLP(s *rlp.Stream) error
- func (b *SnailBlock) DeprecatedTd() *big.Int
- func (b *SnailBlock) Difficulty() *big.Int
- func (b *SnailBlock) EncodeRLP(w io.Writer) error
- func (b *SnailBlock) Extra() []byte
- func (b *SnailBlock) FastHash() common.Hash
- func (b *SnailBlock) FastNumber() *big.Int
- func (b *SnailBlock) FruitDifficulty() *big.Int
- func (b *SnailBlock) Fruits() []*SnailBlock
- func (b *SnailBlock) FruitsHash() common.Hash
- func (b *SnailBlock) GetPubKey() (*ecdsa.PublicKey, error)
- func (b *SnailBlock) Hash() common.Hash
- func (b *SnailBlock) HashNoNonce() common.Hash
- func (b *SnailBlock) Header() *SnailHeader
- func (b *SnailBlock) IsFruit() bool
- func (b *SnailBlock) MaxFruitNumber() *big.Int
- func (b *SnailBlock) MixDigest() common.Hash
- func (b *SnailBlock) Nonce() uint64
- func (b *SnailBlock) Number() *big.Int
- func (b *SnailBlock) NumberU64() uint64
- func (b *SnailBlock) ParentHash() common.Hash
- func (b *SnailBlock) PointNumber() *big.Int
- func (b *SnailBlock) PointerHash() common.Hash
- func (b *SnailBlock) PublicKey() []byte
- func (b *SnailBlock) SetSnailBlockFruits(fruits Fruits)
- func (b *SnailBlock) SetSnailBlockSigns(signs []*PbftSign)
- func (b *SnailBlock) Signs() PbftSigns
- func (b *SnailBlock) Size() common.StorageSize
- func (b *SnailBlock) Time() *big.Int
- func (b *SnailBlock) ToElect() bool
- func (b *SnailBlock) WithBody(fruits []*SnailBlock, uncles []*SnailHeader) *SnailBlock
- func (b *SnailBlock) WithSeal(header *SnailHeader) *SnailBlock
- type SnailBlockBy
- type SnailBlocks
- type SnailBody
- type SnailChainEvent
- type SnailChainHeadEvent
- type SnailChainSideEvent
- type SnailHeader
- type SnailRewardContenet
- type SwitchEnter
- type SwitchEnters
- type SwitchInfos
- type TIP1Signer
- func (s TIP1Signer) Equal(s2 Signer) bool
- func (s TIP1Signer) Hash(tx *Transaction) common.Hash
- func (s TIP1Signer) Hash_Payment(tx *Transaction) common.Hash
- func (s TIP1Signer) Payer(tx *Transaction) (common.Address, error)
- func (s TIP1Signer) Sender(tx *Transaction) (common.Address, error)
- func (s TIP1Signer) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big.Int, err error)
- type Transaction
- func NewContractCreation(nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction
- func NewContractCreation_Payment(nonce uint64, amount *big.Int, fee *big.Int, gasLimit uint64, ...) *Transaction
- func NewTransaction(nonce uint64, to common.Address, amount *big.Int, gasLimit uint64, ...) *Transaction
- func NewTransaction_Payment(nonce uint64, to common.Address, amount *big.Int, fee *big.Int, ...) *Transaction
- func SignTx(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error)
- func SignTx_Payment(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error)
- func (tx *Transaction) AmountCost() *big.Int
- func (tx *Transaction) AsMessage(s Signer) (Message, error)
- func (tx *Transaction) ChainId() *big.Int
- func (tx *Transaction) CheckNonce() bool
- func (tx *Transaction) ConvertRawTransaction() *RawTransaction
- func (tx *Transaction) Cost() *big.Int
- func (tx *Transaction) Data() []byte
- func (tx *Transaction) DecodeRLP(s *rlp.Stream) error
- func (tx *Transaction) EncodeRLP(w io.Writer) error
- func (tx *Transaction) Fee() *big.Int
- func (tx *Transaction) Gas() uint64
- func (tx *Transaction) GasCost() *big.Int
- func (tx *Transaction) GasPrice() *big.Int
- func (tx *Transaction) Hash() common.Hash
- func (tx *Transaction) Info() string
- func (tx *Transaction) MarshalJSON() ([]byte, error)
- func (tx *Transaction) Nonce() uint64
- func (tx *Transaction) Payer() *common.Address
- func (tx *Transaction) Protected() bool
- func (tx *Transaction) Protected_Payment() bool
- func (tx *Transaction) RawSignatureValues() (*big.Int, *big.Int, *big.Int)
- func (tx *Transaction) Size() common.StorageSize
- func (tx *Transaction) To() *common.Address
- func (tx *Transaction) TrueRawSignatureValues() (*big.Int, *big.Int, *big.Int)
- func (tx *Transaction) UnmarshalJSON(input []byte) error
- func (tx *Transaction) Value() *big.Int
- func (tx *Transaction) WithSignature(signer Signer, sig []byte) (*Transaction, error)
- func (tx *Transaction) WithSignature_Payment(signer Signer, sig []byte) (*Transaction, error)
- type Transactions
- type TransactionsByPriceAndNonce
- type TransportCommitteeNode
- type TxByNonce
- type TxByPrice
Constants ¶
const ( // BloomByteLength represents the number of bytes used in a header log bloom. BloomByteLength = 256 // BloomBitLength represents the number of bits used in a header log bloom. BloomBitLength = 8 * BloomByteLength )
const ( // CommitteeStart start pbft consensus CommitteeStart = iota // CommitteeStop stop pbft consensus CommitteeStop // CommitteeSwitchover switch pbft committee CommitteeSwitchover // CommitteeUpdate update committee members and backups CommitteeUpdate // CommitteeOver notify current pbft committee end fastBlock CommitteeOver StateUnusedFlag = 0xa0 StateUsedFlag = 0xa1 StateSwitchingFlag = 0xa2 StateRemovedFlag = 0xa3 StateAppendFlag = 0xa4 // health enter type TypeFixed = 0xa1 TypeWorked = 0xa2 TypeBack = 0xa3 )
const ( //VoteAgreeAgainst vote sign with against VoteAgreeAgainst = iota //VoteAgree vote sign with agree VoteAgree Normal = iota FetcherCall DownloaderCall SFetcherCall SDownloaderCall PeerSendCall FetcherHeadCall SFetcherHeadCall DownloaderFetchCall DownloaderPartCall SDownloaderFetchCall SDownloaderLoopCall SDownloaderPartCall )
const ( // ReceiptStatusFailed is the status code of a transaction if execution failed. ReceiptStatusFailed = uint64(0) // ReceiptStatusSuccessful is the status code of a transaction if execution succeeded. ReceiptStatusSuccessful = uint64(1) )
Variables ¶
var ( EmptyRootHash = DeriveSha(Transactions{}) EmptyUncleHash = CalcUncleHash(nil) EmptySignHash = CalcSignHash(nil) )
var ( // ErrHeightNotYet When the height of the committee is higher than the local height, it is issued. ErrHeightNotYet = errors.New("pbft send block height not yet") // ErrSnailHeightNotYet Snail height not yet ErrSnailHeightNotYet = errors.New("Snail height not yet") //ErrSnailBlockNotOnTheCain Snail block not on the cain ErrSnailBlockNotOnTheCain = errors.New("Snail block not on the chain") //ErrSnailBlockTooSlow Snail block too slow ErrSnailBlockTooSlow = errors.New("Snail block too slow") ErrPayersign = errors.New("signed_addr not equal tx.data.Payer") )
var Bloom9 = bloom9
var (
ErrInvalidChainId = errors.New("invalid chain id for signer")
)
var (
ErrInvalidSig = errors.New("invalid transaction v, r, s values")
)
Functions ¶
func BloomLookup ¶
func CalcSignHash ¶
func CalcUncleHash ¶
func DeriveSha ¶
func DeriveSha(list DerivableList) common.Hash
func FruitNumber ¶
func FruitNumber(b1, b2 *SnailBlock) bool
func Payer ¶
func Payer(signer Signer, tx *Transaction) (common.Address, error)
PSender returns the address derived from the signature (PV, PR, PS) using secp256k1 elliptic curve and an error if it failed deriving or upon an incorrect signature.
func Sender ¶
func Sender(signer Signer, tx *Transaction) (common.Address, error)
Sender returns the address derived from the signature (V, R, S) using secp256k1 elliptic curve and an error if it failed deriving or upon an incorrect signature.
Sender may cache the address, allowing it to be used regardless of signing method. The cache is invalidated if the cached signer does not match the signer used in the current call.
func SignatureValues ¶ added in v0.10.1
func SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error)
func SnailNumber ¶
func SnailNumber(b1, b2 *SnailBlock) bool
Types ¶
type Block ¶
type Block struct { // These fields are used by package etrue to track // inter-peer block relay. ReceivedAt time.Time ReceivedFrom interface{} // contains filtered or unexported fields }
Block represents an entire block in the truechain blockchain.
func NewBlock ¶
func NewBlock(header *Header, txs []*Transaction, receipts []*Receipt, signs []*PbftSign, infos []*CommitteeMember) *Block
NewBlock creates a new fast block. The input data is copied, changes to header and to the field values will not affect the block.
The values of TxHash, ReceiptHash and Bloom in header are ignored and set to values derived from the given txs and receipts.
func NewBlockWithHeader ¶
NewBlockWithHeader creates a fast block with the given header data. The header data is copied, changes to header and to the field values will not affect the block.
func (*Block) AppendSign ¶
func (*Block) AppendSigns ¶
func (*Block) CommitteeHash ¶
func (*Block) GetLeaderSign ¶
func (*Block) Hash ¶
Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.
func (*Block) IsProposal ¶
Condition when proposal block award or switch is not nil
func (*Block) ParentHash ¶
func (*Block) ReceiptHash ¶
func (*Block) SignedHash ¶
func (*Block) Size ¶
func (b *Block) Size() common.StorageSize
Size returns the true RLP encoded storage size of the block, either by encoding and returning it, or returning a previsouly cached value.
func (*Block) SnailNumber ¶
func (*Block) SwitchInfos ¶
func (b *Block) SwitchInfos() []*CommitteeMember
func (*Block) Transaction ¶
func (b *Block) Transaction(hash common.Hash) *Transaction
func (*Block) Transactions ¶
func (b *Block) Transactions() Transactions
func (*Block) WithBody ¶
func (b *Block) WithBody(transactions []*Transaction, signs []*PbftSign, infos []*CommitteeMember) *Block
WithBody returns a new block with the given transaction contents.
type BlockNonce ¶
type BlockNonce [8]byte
A BlockNonce is a 64-bit hash which proves (combined with the mix-hash) that a sufficient amount of computation has been carried out on a block.
func EncodeNonce ¶
func EncodeNonce(i uint64) BlockNonce
EncodeNonce converts the given integer to a block nonce.
func (BlockNonce) MarshalText ¶
func (n BlockNonce) MarshalText() ([]byte, error)
MarshalText encodes n as a hex string with 0x prefix.
func (BlockNonce) Uint64 ¶
func (n BlockNonce) Uint64() uint64
Uint64 returns the integer value of a block nonce.
func (*BlockNonce) UnmarshalText ¶
func (n *BlockNonce) UnmarshalText(input []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type BlockReward ¶
type BlockReward struct { FastHash common.Hash `json:"FastHash" gencodec:"required"` FastNumber *big.Int `json:"FastNumber" gencodec:"required"` SnailHash common.Hash `json:"SnailHash" gencodec:"required"` SnailNumber *big.Int `json:"SnailNumber" gencodec:"required"` }
BlockReward
type Bloom ¶
type Bloom [BloomByteLength]byte
Bloom represents a 2048 bit bloom filter.
func BytesToBloom ¶
BytesToBloom converts a byte slice to a bloom filter. It panics if b is not of suitable size.
func CreateBloom ¶
func (Bloom) MarshalText ¶
MarshalText encodes b as a hex string with 0x prefix.
func (*Bloom) SetBytes ¶
SetBytes sets the content of b to the given bytes. It panics if d is not of suitable size.
func (*Bloom) UnmarshalText ¶
UnmarshalText b as a hex string with 0x prefix.
type Body ¶
type Body struct { Transactions []*Transaction Signs []*PbftSign Infos []*CommitteeMember }
Body is a simple (mutable, non-safe) data container for storing and moving a block's data contents (transactions and uncles) together.
func (*Body) GetLeaderSign ¶
GetLeaderSign get the sign for proposal
func (*Body) GetSwitchInfo ¶
func (b *Body) GetSwitchInfo() []*CommitteeMember
GetSwitchInfo get info for shift committee
func (*Body) SetLeaderSign ¶
SetLeaderSign keep the sign on the head for proposal
func (*Body) SetSwitchInfo ¶
func (b *Body) SetSwitchInfo(infos []*CommitteeMember)
SetSwitchInfo set info for shift committee
type CommitteeInfo ¶
type CommitteeInfo struct { Id *big.Int StartHeight *big.Int EndHeight *big.Int Members []*CommitteeMember BackMembers []*CommitteeMember }
func CopyCommitteeInfo ¶ added in v1.0.0
func CopyCommitteeInfo(committeeInfo *CommitteeInfo) *CommitteeInfo
func (*CommitteeInfo) GetAllMembers ¶
func (c *CommitteeInfo) GetAllMembers() []*CommitteeMember
func (*CommitteeInfo) String ¶
func (c *CommitteeInfo) String() string
type CommitteeMember ¶
type CommitteeMember struct { Coinbase common.Address CommitteeBase common.Address Publickey []byte Flag uint32 MType uint32 }
func NewCommitteeMember ¶
func NewCommitteeMember(coinBase common.Address, publicKey []byte, flag, mType uint32) *CommitteeMember
func (*CommitteeMember) Compared ¶
func (c *CommitteeMember) Compared(d *CommitteeMember) bool
func (*CommitteeMember) String ¶
func (c *CommitteeMember) String() string
func (*CommitteeMember) UnmarshalJSON ¶
func (c *CommitteeMember) UnmarshalJSON(input []byte) error
type CommitteeNode ¶
type CommitteeNode struct { IP string Port uint32 Port2 uint32 Coinbase common.Address Publickey []byte }
CommitteeNode contains main info of committee node
func (*CommitteeNode) ConvertCommitteeNodeToTransport ¶ added in v0.10.2
func (cn *CommitteeNode) ConvertCommitteeNodeToTransport() *TransportCommitteeNode
func (*CommitteeNode) String ¶
func (c *CommitteeNode) String() string
type CommitteeNodeTag ¶
func (*CommitteeNodeTag) Hash ¶
func (c *CommitteeNodeTag) Hash() common.Hash
type DerivableList ¶
type ElectionCommittee ¶
type ElectionCommittee struct { Members []*CommitteeMember Backups []*CommitteeMember }
ElectionCommittee defines election members result
type ElectionEvent ¶
type ElectionEvent struct { Option uint CommitteeID *big.Int CommitteeMembers []*CommitteeMember BackupMembers []*CommitteeMember BeginFastNumber *big.Int EndFastNumber *big.Int }
type EncryptCommitteeNode ¶
type EncryptCommitteeNode []byte
EncryptCommitteeNode represent a committee member encrypt info which encrypt committeeNode with member Publickey
type EncryptNodeMessage ¶
type EncryptNodeMessage struct { CreatedAt *big.Int CommitteeID *big.Int Nodes []EncryptCommitteeNode Sign //sign msg // contains filtered or unexported fields }
EncryptNodeMessage all information of the committee
func (*EncryptNodeMessage) DecodeRLP ¶
func (c *EncryptNodeMessage) DecodeRLP(s *rlp.Stream) error
DecodeRLP decodes the truechain
func (*EncryptNodeMessage) EncodeRLP ¶
func (c *EncryptNodeMessage) EncodeRLP(w io.Writer) error
EncodeRLP serializes b into the truechain RLP block format.
func (*EncryptNodeMessage) Hash ¶
func (c *EncryptNodeMessage) Hash() common.Hash
func (*EncryptNodeMessage) HashWithoutSign ¶
func (c *EncryptNodeMessage) HashWithoutSign() common.Hash
func (*EncryptNodeMessage) Size ¶
func (c *EncryptNodeMessage) Size() common.StorageSize
func (*EncryptNodeMessage) String ¶
func (c *EncryptNodeMessage) String(str string)
type FastChainEvent ¶ added in v0.10.2
type FastChainHeadEvent ¶ added in v0.10.2
type FastChainHeadEvent struct{ Block *Block }
type FastChainSideEvent ¶ added in v0.10.2
type FastChainSideEvent struct {
Block *Block
}
type FruitEvent ¶
FruitEvent for fruit event,seems not used
type Fruits ¶
type Fruits []*SnailBlock
Fruits is a wrapper around a fruit array to implement DerivableList.
type FruitsHeaders ¶ added in v1.1.1
type FruitsHeaders []*SnailHeader
Headers is a wrapper around a fruit header array to implement DerivableList.
func (FruitsHeaders) GetRlp ¶ added in v1.1.1
func (fs FruitsHeaders) GetRlp(i int) []byte
GetRlp returns the RLP encoding of one fruit header from the list.
func (FruitsHeaders) Len ¶ added in v1.1.1
func (fs FruitsHeaders) Len() int
Len returns the number of headers in this list.
type GenesisAccount ¶
type GenesisAccount struct { Code []byte `json:"code,omitempty"` Storage map[common.Hash]common.Hash `json:"storage,omitempty"` Balance *big.Int `json:"balance" gencodec:"required"` Nonce uint64 `json:"nonce,omitempty"` PrivateKey []byte `json:"secretKey,omitempty"` // for tests }
GenesisAccount is an account in the state of the genesis block.
func (GenesisAccount) MarshalJSON ¶ added in v0.10.1
func (g GenesisAccount) MarshalJSON() ([]byte, error)
func (*GenesisAccount) UnmarshalJSON ¶ added in v0.10.1
func (g *GenesisAccount) UnmarshalJSON(input []byte) error
type GenesisAlloc ¶
type GenesisAlloc map[common.Address]GenesisAccount
func DecodePrealloc ¶
func DecodePrealloc(data string) GenesisAlloc
func (*GenesisAlloc) UnmarshalJSON ¶
func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error
type GenesisMismatchError ¶
GenesisMismatchError is raised when trying to overwrite an existing genesis block with an incompatible one.
func (*GenesisMismatchError) Error ¶
func (e *GenesisMismatchError) Error() string
type Header ¶
type Header struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` Root common.Hash `json:"stateRoot" gencodec:"required"` TxHash common.Hash `json:"transactionsRoot" gencodec:"required"` ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"` CommitteeHash common.Hash `json:"committeeRoot" gencodec:"required"` Proposer common.Address `json:"maker" gencodec:"required"` Bloom Bloom `json:"logsBloom" gencodec:"required"` SnailHash common.Hash `json:"snailHash" gencodec:"required"` SnailNumber *big.Int `json:"snailNumber" gencodec:"required"` Number *big.Int `json:"number" gencodec:"required"` GasLimit uint64 `json:"gasLimit" gencodec:"required"` GasUsed uint64 `json:"gasUsed" gencodec:"required"` Time *big.Int `json:"timestamp" gencodec:"required"` Extra []byte `json:"extraData" gencodec:"required"` }
Header represents a block header in the true blockchain.
func CopyHeader ¶
CopyHeader creates a deep copy of a fast block header to prevent side effects from modifying a header variable.
func (*Header) Hash ¶
Hash returns the block hash of the header, which is simply the keccak256 hash of its RLP encoding.
func (Header) MarshalJSON ¶ added in v1.1.2
MarshalJSON marshals as JSON.
func (*Header) Size ¶
func (h *Header) Size() common.StorageSize
Size returns the approximate memory used by all internal contents. It is used to approximate and limit the memory consumption of various caches.
func (*Header) UnmarshalJSON ¶ added in v1.1.2
UnmarshalJSON unmarshals from JSON.
type Log ¶
type Log struct { // Consensus fields: // address of the contract that generated the event Address common.Address `json:"address" gencodec:"required"` // list of topics provided by the contract. Topics []common.Hash `json:"topics" gencodec:"required"` // supplied by the contract, usually ABI-encoded Data []byte `json:"data" gencodec:"required"` // Derived fields. These fields are filled in by the node // but not secured by consensus. // block in which the transaction was included BlockNumber uint64 `json:"blockNumber"` // hash of the transaction TxHash common.Hash `json:"transactionHash" gencodec:"required"` // index of the transaction in the block TxIndex uint `json:"transactionIndex" gencodec:"required"` // hash of the block in which the transaction was included BlockHash common.Hash `json:"blockHash"` // index of the log in the receipt Index uint `json:"logIndex" gencodec:"required"` // The Removed field is true if this log was reverted due to a chain reorganisation. // You must pay attention to this field if you receive logs through a filter query. Removed bool `json:"removed"` }
Log represents a contract log event. These events are generated by the LOG opcode and stored/indexed by the node.
func (Log) MarshalJSON ¶
func (*Log) UnmarshalJSON ¶
type LogForStorage ¶
type LogForStorage Log
LogForStorage is a wrapper around a Log that flattens and parses the entire content of a log including non-consensus fields.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is a fully derived transaction and implements core.Message
NOTE: In a future PR this will be removed.
func NewMessage ¶
func (Message) CheckNonce ¶
type NewFastBlocksEvent ¶
type NewFastBlocksEvent struct{ FastBlocks []*Block }
NewFastBlocksEvent is posted when a block has been imported.
type NewFruitsEvent ¶
type NewFruitsEvent struct{ Fruits []*SnailBlock }
NewFruitsEvent is posted when a fruit has been imported.
type NewMinedBlockEvent ¶
type NewMinedBlockEvent struct{ Block *SnailBlock }
NewMinedBlockEvent is posted when a block has been imported.
type NewMinedFruitEvent ¶
type NewMinedFruitEvent struct{ Block *SnailBlock }
NewMinedFruitEvent is posted when a block has been Mined.
type NewTxsEvent ¶
type NewTxsEvent struct{ Txs []*Transaction }
NewTxsEvent is posted when a batch of transactions enter the transaction pool.
type NodeInfoEvent ¶
type NodeInfoEvent struct{ NodeInfo *EncryptNodeMessage }
NodeInfoEvent is posted when nodeInfo send
type PbftAgentProxy ¶
type PbftAgentProxy interface { FetchFastBlock(committeeId *big.Int, infos []*CommitteeMember) (*Block, error) VerifyFastBlock(*Block, bool) (*PbftSign, error) BroadcastConsensus(block *Block) error GetCurrentHeight() *big.Int GetSeedMember() []*CommitteeMember GetFastLastProposer() common.Address }
type PbftServerProxy ¶
type PbftServerProxy interface { PutCommittee(committeeInfo *CommitteeInfo) error UpdateCommittee(info *CommitteeInfo) error PutNodes(id *big.Int, nodes []*CommitteeNode) error Notify(id *big.Int, action int) error SetCommitteeStop(committeeId *big.Int, stop uint64) error GetCommitteeStatus(committeeID *big.Int) map[string]interface{} IsLeader(committeeID *big.Int) bool }
type PbftSign ¶
type PbftSign struct { FastHeight *big.Int FastHash common.Hash // fastblock hash Result uint32 // 0--against,1--agree Sign []byte // sign for fastblock height + hash + result // contains filtered or unexported fields }
func CopyPbftSign ¶
func (*PbftSign) EncodeRLP ¶ added in v0.10.2
EncodeRLP serializes b into the truechain RLP block format.
func (*PbftSign) Hash ¶
Hash returns the block hash of the PbftSign, which is simply the keccak256 hash of its RLP encoding.
func (*PbftSign) HashWithNoSign ¶
HashWithNoSign returns the hash which PbftSign without sign
func (PbftSign) MarshalJSON ¶ added in v1.1.2
MarshalJSON marshals as JSON.
func (*PbftSign) UnmarshalJSON ¶ added in v1.1.2
UnmarshalJSON unmarshals from JSON.
type PbftSignEvent ¶
type PendingLogsEvent ¶
type PendingLogsEvent struct {
Logs []*Log
}
PendingLogsEvent is posted pre mining and notifies of pending logs.
type PendingStateEvent ¶
type PendingStateEvent struct{}
PendingStateEvent is posted pre mining and notifies of pending state changes.
type RawTransaction ¶
type RawTransaction struct {
// contains filtered or unexported fields
}
func NewRawTransaction ¶
func (*RawTransaction) ConvertTransaction ¶
func (rawTransaction *RawTransaction) ConvertTransaction() *Transaction
func (*RawTransaction) DecodeRLP ¶
func (tx *RawTransaction) DecodeRLP(s *rlp.Stream) error
DecodeRLP implements rlp.Decoder
func (*RawTransaction) EncodeRLP ¶
func (tx *RawTransaction) EncodeRLP(w io.Writer) error
EncodeRLP implements rlp.Encoder
func (*RawTransaction) Info ¶
func (tx *RawTransaction) Info() string
type Receipt ¶
type Receipt struct { // Consensus fields PostState []byte `json:"root"` Status uint64 `json:"status"` CumulativeGasUsed uint64 `json:"cumulativeGasUsed" gencodec:"required"` Bloom Bloom `json:"logsBloom" gencodec:"required"` Logs []*Log `json:"logs" gencodec:"required"` // Implementation fields (don't reorder!) TxHash common.Hash `json:"transactionHash" gencodec:"required"` ContractAddress common.Address `json:"contractAddress"` GasUsed uint64 `json:"gasUsed" gencodec:"required"` }
Receipt represents the results of a transaction.
func NewReceipt ¶
NewReceipt creates a barebone transaction receipt, copying the init fields.
func (*Receipt) DecodeRLP ¶
DecodeRLP implements rlp.Decoder, and loads the consensus fields of a receipt from an RLP stream.
func (*Receipt) EncodeRLP ¶
EncodeRLP implements rlp.Encoder, and flattens the consensus fields of a receipt into an RLP stream. If no post state is present, byzantium fork is assumed.
func (Receipt) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Receipt) Size ¶
func (r *Receipt) Size() common.StorageSize
Size returns the approximate memory used by all internal contents. It is used to approximate and limit the memory consumption of various caches.
func (*Receipt) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type ReceiptForStorage ¶
type ReceiptForStorage Receipt
ReceiptForStorage is a wrapper around a Receipt that flattens and parses the entire content of a receipt, as opposed to only the consensus fields originally.
type Receipts ¶
type Receipts []*Receipt
Receipts is a wrapper around a Receipt array to implement DerivableList.
type RemovedLogsEvent ¶
type RemovedLogsEvent struct{ Logs []*Log }
RemovedLogsEvent is posted when a reorg happens
type Signer ¶
type Signer interface { // Sender returns the sender address of the transaction. Sender(tx *Transaction) (common.Address, error) // PSender returns the paid address of the transaction. Payer(tx *Transaction) (common.Address, error) // SignatureValues returns the raw R, S, V values corresponding to the // given signature. SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error) // Hash returns the hash to be signed. Hash(tx *Transaction) common.Hash Hash_Payment(tx *Transaction) common.Hash // Equal returns true if the given signer is the same as the receiver. Equal(Signer) bool }
Signer encapsulates transaction signature handling. Note that this interface is not a stable API and may change at any time to accommodate new protocol rules.
func MakeSigner ¶
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer
MakeSigner returns a Signer based on the given chain config and block number.
type SnailBlock ¶
type SnailBlock struct { // These fields are used by package etrue to track // inter-peer block relay. ReceivedAt time.Time ReceivedFrom interface{} // contains filtered or unexported fields }
SnailBlock represents an entire snail block in the TrueChain snail chain.
func CopyFruit ¶
func CopyFruit(f *SnailBlock) *SnailBlock
func NewSnailBlock ¶
func NewSnailBlock(header *SnailHeader, fruits []*SnailBlock, signs []*PbftSign, uncles []*SnailHeader, config *params.ChainConfig) *SnailBlock
NewSnailBlock creates a new block. The input data is copied, changes to header and to the field values will not affect the block.
func NewSnailBlockWithHeader ¶
func NewSnailBlockWithHeader(header *SnailHeader) *SnailBlock
NewSnailBlockWithHeader creates a block with the given header data. The header data is copied, changes to header and to the field values will not affect the block.
func (*SnailBlock) BlockDifficulty ¶
func (b *SnailBlock) BlockDifficulty() *big.Int
func (*SnailBlock) Body ¶
func (b *SnailBlock) Body() *SnailBody
Body returns the non-header content of the snailblock. func (b *SnailBlock) Body() *SnailBody { return b.body }
func (*SnailBlock) Coinbase ¶
func (b *SnailBlock) Coinbase() common.Address
func (*SnailBlock) DecodeRLP ¶
func (b *SnailBlock) DecodeRLP(s *rlp.Stream) error
DecodeRLP decodes the SnailBlock
func (*SnailBlock) DeprecatedTd ¶
func (b *SnailBlock) DeprecatedTd() *big.Int
DeprecatedTd is an old relic for extracting the TD of a block. It is in the code solely to facilitate upgrading the database from the old format to the new, after which it should be deleted. Do not use!
func (*SnailBlock) Difficulty ¶
func (b *SnailBlock) Difficulty() *big.Int
func (*SnailBlock) EncodeRLP ¶
func (b *SnailBlock) EncodeRLP(w io.Writer) error
EncodeRLP serializes b into the TrueChain RLP block format.
func (*SnailBlock) Extra ¶
func (b *SnailBlock) Extra() []byte
func (*SnailBlock) FastHash ¶
func (b *SnailBlock) FastHash() common.Hash
func (*SnailBlock) FastNumber ¶
func (b *SnailBlock) FastNumber() *big.Int
func (*SnailBlock) FruitDifficulty ¶
func (b *SnailBlock) FruitDifficulty() *big.Int
func (*SnailBlock) Fruits ¶
func (b *SnailBlock) Fruits() []*SnailBlock
func (*SnailBlock) FruitsHash ¶
func (b *SnailBlock) FruitsHash() common.Hash
func (*SnailBlock) Hash ¶
func (b *SnailBlock) Hash() common.Hash
Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.
func (*SnailBlock) HashNoNonce ¶
func (b *SnailBlock) HashNoNonce() common.Hash
func (*SnailBlock) Header ¶
func (b *SnailBlock) Header() *SnailHeader
func (*SnailBlock) IsFruit ¶
func (b *SnailBlock) IsFruit() bool
func (*SnailBlock) MaxFruitNumber ¶
func (b *SnailBlock) MaxFruitNumber() *big.Int
func (*SnailBlock) MixDigest ¶
func (b *SnailBlock) MixDigest() common.Hash
func (*SnailBlock) Nonce ¶
func (b *SnailBlock) Nonce() uint64
func (*SnailBlock) Number ¶
func (b *SnailBlock) Number() *big.Int
func (*SnailBlock) NumberU64 ¶
func (b *SnailBlock) NumberU64() uint64
func (*SnailBlock) ParentHash ¶
func (b *SnailBlock) ParentHash() common.Hash
func (*SnailBlock) PointNumber ¶
func (b *SnailBlock) PointNumber() *big.Int
func (*SnailBlock) PointerHash ¶
func (b *SnailBlock) PointerHash() common.Hash
func (*SnailBlock) PublicKey ¶
func (b *SnailBlock) PublicKey() []byte
func (*SnailBlock) SetSnailBlockFruits ¶
func (b *SnailBlock) SetSnailBlockFruits(fruits Fruits)
func (*SnailBlock) SetSnailBlockSigns ¶
func (b *SnailBlock) SetSnailBlockSigns(signs []*PbftSign)
func (*SnailBlock) Signs ¶
func (b *SnailBlock) Signs() PbftSigns
func (*SnailBlock) Size ¶
func (b *SnailBlock) Size() common.StorageSize
Size returns the true RLP encoded storage size of the block, either by encoding and returning it, or returning a previsouly cached value.
func (*SnailBlock) Time ¶
func (b *SnailBlock) Time() *big.Int
func (*SnailBlock) ToElect ¶
func (b *SnailBlock) ToElect() bool
func (*SnailBlock) WithBody ¶
func (b *SnailBlock) WithBody(fruits []*SnailBlock, uncles []*SnailHeader) *SnailBlock
WithBody returns a new snailblock with the given transaction and uncle contents.
func (*SnailBlock) WithSeal ¶
func (b *SnailBlock) WithSeal(header *SnailHeader) *SnailBlock
WithSeal returns a new snailblock with the data from b but the header replaced with the sealed one.
type SnailBlockBy ¶
type SnailBlockBy func(b1, b2 *SnailBlock) bool
func (SnailBlockBy) Sort ¶
func (self SnailBlockBy) Sort(snailBlocks SnailBlocks)
type SnailBlocks ¶
type SnailBlocks []*SnailBlock
type SnailBody ¶
type SnailBody struct { Fruits []*SnailBlock Signs []*PbftSign }
func (*SnailBody) FruitsHeaders ¶ added in v1.1.1
func (b *SnailBody) FruitsHeaders() []*SnailHeader
type SnailChainEvent ¶ added in v0.10.2
type SnailChainEvent struct { Block *SnailBlock Hash common.Hash }
type SnailChainHeadEvent ¶ added in v0.10.2
type SnailChainHeadEvent struct{ Block *SnailBlock }
type SnailChainSideEvent ¶ added in v0.10.2
type SnailChainSideEvent struct {
Block *SnailBlock
}
SnailChainSideEvent is posted when a block in SideStatTy
type SnailHeader ¶
type SnailHeader struct { ParentHash common.Hash `json:"parentHash" gencodec:"required"` Coinbase common.Address `json:"miner" gencodec:"required"` PointerHash common.Hash `json:"pointerHash" gencodec:"required"` PointerNumber *big.Int `json:"pointerNumber" gencodec:"required"` FruitsHash common.Hash `json:"fruitsHash" gencodec:"required"` FastHash common.Hash `json:"fastHash" gencodec:"required"` FastNumber *big.Int `json:"fastNumber" gencodec:"required"` SignHash common.Hash `json:"signHash" gencodec:"required"` Difficulty *big.Int `json:"difficulty" gencodec:"required"` FruitDifficulty *big.Int `json:"fruitDifficulty" gencodec:"required"` Number *big.Int `json:"number" gencodec:"required"` Publickey []byte `json:"publicKey" gencodec:"required"` Time *big.Int `json:"timestamp" gencodec:"required"` Extra []byte `json:"extraData" gencodec:"required"` MixDigest common.Hash `json:"mixHash" gencodec:"required"` Nonce BlockNonce `json:"nonce" gencodec:"required"` }
SnailHeader represents a block header in the truechain truechain.
func CopySnailHeader ¶
func CopySnailHeader(h *SnailHeader) *SnailHeader
CopySnailHeader creates a deep copy of a snail block header to prevent side effects from modifying a header variable.
func (*SnailHeader) Hash ¶
func (h *SnailHeader) Hash() common.Hash
Hash returns the block hash of the header, which is simply the keccak256 hash of its RLP encoding.
func (*SnailHeader) HashNoNonce ¶
func (h *SnailHeader) HashNoNonce() common.Hash
HashNoNonce returns the hash which is used as input for the proof-of-work search.
func (*SnailHeader) Size ¶
func (h *SnailHeader) Size() common.StorageSize
Size returns the approximate memory used by all internal contents. It is used to approximate and limit the memory consumption of various caches.
type SnailRewardContenet ¶ added in v1.0.2
type SwitchEnter ¶
SwitchEnter is the enter inserted in block when committee member changed
func (*SwitchEnter) Equal ¶
func (s *SwitchEnter) Equal(other *SwitchEnter) bool
func (*SwitchEnter) String ¶
func (s *SwitchEnter) String() string
type SwitchEnters ¶
type SwitchEnters []*SwitchEnter
func (SwitchEnters) Equal ¶
func (s SwitchEnters) Equal(other SwitchEnters) bool
Equal will equal not require item index
type SwitchInfos ¶
type SwitchInfos struct { CID *big.Int Members []*CommitteeMember BackMembers []*CommitteeMember Vals []*SwitchEnter }
SwitchInfos is the infos inserted in block when committee member changed
func (*SwitchInfos) Equal ¶
func (s *SwitchInfos) Equal(other *SwitchInfos) bool
func (*SwitchInfos) Hash ¶
func (s *SwitchInfos) Hash() common.Hash
Hash return SwitchInfos hash bytes
func (*SwitchInfos) String ¶
func (s *SwitchInfos) String() string
func (*SwitchInfos) ToHash ¶
func (s *SwitchInfos) ToHash() common.Hash
type TIP1Signer ¶
type TIP1Signer struct {
// contains filtered or unexported fields
}
func NewTIP1Signer ¶
func NewTIP1Signer(chainId *big.Int) TIP1Signer
func (TIP1Signer) Equal ¶
func (s TIP1Signer) Equal(s2 Signer) bool
func (TIP1Signer) Hash ¶
func (s TIP1Signer) Hash(tx *Transaction) common.Hash
Hash returns the hash to be signed by the sender. It does not uniquely identify the transaction.
func (TIP1Signer) Hash_Payment ¶
func (s TIP1Signer) Hash_Payment(tx *Transaction) common.Hash
func (TIP1Signer) Payer ¶
func (s TIP1Signer) Payer(tx *Transaction) (common.Address, error)
func (TIP1Signer) Sender ¶
func (s TIP1Signer) Sender(tx *Transaction) (common.Address, error)
func (TIP1Signer) SignatureValues ¶
func (s TIP1Signer) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big.Int, err error)
WithSignature returns a new transaction with the given signature. This signature needs to be in the [R || S || V] format where V is 0 or 1.
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func NewContractCreation ¶
func NewTransaction ¶
func NewTransaction_Payment ¶
func SignTx ¶
func SignTx(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error)
SignTx signs the transaction using the given signer and private key
func SignTx_Payment ¶
func SignTx_Payment(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error)
func (*Transaction) AmountCost ¶
func (tx *Transaction) AmountCost() *big.Int
AmountCost returns amount+Fee.
func (*Transaction) AsMessage ¶
func (tx *Transaction) AsMessage(s Signer) (Message, error)
AsMessage returns the transaction as a core.Message.
AsMessage requires a signer to derive the sender.
XXX Rename message to something less arbitrary?
func (*Transaction) ChainId ¶
func (tx *Transaction) ChainId() *big.Int
ChainId returns which chain id this transaction was signed for (if at all)
func (*Transaction) CheckNonce ¶
func (tx *Transaction) CheckNonce() bool
func (*Transaction) ConvertRawTransaction ¶
func (tx *Transaction) ConvertRawTransaction() *RawTransaction
func (*Transaction) Cost ¶
func (tx *Transaction) Cost() *big.Int
Cost returns amount + gasprice * gaslimit.
func (*Transaction) Data ¶
func (tx *Transaction) Data() []byte
func (*Transaction) DecodeRLP ¶
func (tx *Transaction) DecodeRLP(s *rlp.Stream) error
DecodeRLP implements rlp.Decoder
func (*Transaction) EncodeRLP ¶
func (tx *Transaction) EncodeRLP(w io.Writer) error
EncodeRLP implements rlp.Encoder
func (*Transaction) Fee ¶
func (tx *Transaction) Fee() *big.Int
func (*Transaction) Gas ¶
func (tx *Transaction) Gas() uint64
func (*Transaction) GasCost ¶
func (tx *Transaction) GasCost() *big.Int
GasCost returns gasprice * gaslimit.
func (*Transaction) GasPrice ¶
func (tx *Transaction) GasPrice() *big.Int
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() common.Hash
Hash hashes the RLP encoding of tx. It uniquely identifies the transaction.
func (*Transaction) Info ¶
func (tx *Transaction) Info() string
func (*Transaction) MarshalJSON ¶
func (tx *Transaction) MarshalJSON() ([]byte, error)
MarshalJSON encodes the web3 RPC transaction format.
func (*Transaction) Nonce ¶
func (tx *Transaction) Nonce() uint64
func (*Transaction) Payer ¶ added in v0.10.1
func (tx *Transaction) Payer() *common.Address
func (*Transaction) Protected ¶
func (tx *Transaction) Protected() bool
Protected returns whether the transaction is protected from replay protection.
func (*Transaction) Protected_Payment ¶
func (tx *Transaction) Protected_Payment() bool
func (*Transaction) RawSignatureValues ¶
func (*Transaction) Size ¶
func (tx *Transaction) Size() common.StorageSize
Size returns the true RLP encoded storage size of the transaction, either by encoding and returning it, or returning a previsouly cached value.
func (*Transaction) To ¶
func (tx *Transaction) To() *common.Address
To returns the recipient address of the transaction. It returns nil if the transaction is a contract creation.
func (*Transaction) TrueRawSignatureValues ¶ added in v0.10.1
func (*Transaction) UnmarshalJSON ¶
func (tx *Transaction) UnmarshalJSON(input []byte) error
UnmarshalJSON decodes the web3 RPC transaction format.
func (*Transaction) Value ¶
func (tx *Transaction) Value() *big.Int
func (*Transaction) WithSignature ¶
func (tx *Transaction) WithSignature(signer Signer, sig []byte) (*Transaction, error)
WithSignature returns a new transaction with the given signature. This signature needs to be formatted as described in the yellow paper (v+27).
func (*Transaction) WithSignature_Payment ¶
func (tx *Transaction) WithSignature_Payment(signer Signer, sig []byte) (*Transaction, error)
type Transactions ¶
type Transactions []*Transaction
Transactions is a Transaction slice type for basic sorting.
func TxDifference ¶
func TxDifference(a, b Transactions) (keep Transactions)
TxDifference returns a new set t which is the difference between a to b.
func (Transactions) GetRlp ¶
func (s Transactions) GetRlp(i int) []byte
GetRlp implements Rlpable and returns the i'th element of s in rlp.
func (Transactions) Swap ¶
func (s Transactions) Swap(i, j int)
Swap swaps the i'th and the j'th element in s.
type TransactionsByPriceAndNonce ¶
type TransactionsByPriceAndNonce struct {
// contains filtered or unexported fields
}
TransactionsByPriceAndNonce represents a set of transactions that can return transactions in a profit-maximizing sorted order, while supporting removing entire batches of transactions for non-executable accounts.
func NewTransactionsByPriceAndNonce ¶
func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByPriceAndNonce
NewTransactionsByPriceAndNonce creates a transaction set that can retrieve price sorted transactions in a nonce-honouring way.
Note, the input map is reowned so the caller should not interact any more with if after providing it to the constructor.
func (*TransactionsByPriceAndNonce) Peek ¶
func (t *TransactionsByPriceAndNonce) Peek() *Transaction
Peek returns the next transaction by price.
func (*TransactionsByPriceAndNonce) Pop ¶
func (t *TransactionsByPriceAndNonce) Pop()
Pop removes the best transaction, *not* replacing it with the next one from the same account. This should be used when a transaction cannot be executed and hence all subsequent ones should be discarded from the same account.
func (*TransactionsByPriceAndNonce) Shift ¶
func (t *TransactionsByPriceAndNonce) Shift()
Shift replaces the current best head with the next one from the same account.
type TransportCommitteeNode ¶ added in v0.10.2
func (*TransportCommitteeNode) ConvertTransportToCommitteeNode ¶ added in v0.10.2
func (tcn *TransportCommitteeNode) ConvertTransportToCommitteeNode(pubKey *ecdsa.PublicKey) *CommitteeNode
type TxByNonce ¶
type TxByNonce Transactions
TxByNonce implements the sort interface to allow sorting a list of transactions by their nonces. This is usually only useful for sorting transactions from a single account, otherwise a nonce comparison doesn't make much sense.
type TxByPrice ¶
type TxByPrice Transactions
TxByPrice implements both the sort and the heap interface, making it useful for all at once sorting as well as individually adding and removing elements.