Documentation ¶
Index ¶
- Constants
- func CalcMerkleRootOfReceiptList(receipts module.ReceiptList, txs module.TransactionList, height int64) []byte
- func CalcMerkleRootOfReceiptSlice(receipts []txresult.Receipt, txs []module.Transaction, height int64) []byte
- func CalcOriginalReceiptHash(r module.Receipt, txHash []byte, height int64, txIndex int) []byte
- func TransactionRootForBlockV03(txs []Transaction) []byte
- type Block
- type BlockV01a
- func (b *BlockV01a) Height() int64
- func (b *BlockV01a) ID() []byte
- func (b *BlockV01a) LogsBloom() module.LogsBloom
- func (b *BlockV01a) NextValidators() *RepsList
- func (b *BlockV01a) NormalTransactions() []module.Transaction
- func (b *BlockV01a) PrevID() []byte
- func (b *BlockV01a) Proposer() module.Address
- func (b *BlockV01a) String() string
- func (b *BlockV01a) Timestamp() int64
- func (b *BlockV01a) ToJSON(version module.JSONVersion) (interface{}, error)
- func (b *BlockV01a) TransactionRoot() []byte
- func (b *BlockV01a) Validators() *RepsList
- func (b *BlockV01a) Verify(prev Block) error
- func (b *BlockV01a) Version() string
- func (b *BlockV01a) Votes() *BlockVoteList
- type BlockV01aJSON
- type BlockV03
- func (b *BlockV03) GetNextLeader() module.Address
- func (b *BlockV03) Height() int64
- func (b *BlockV03) ID() []byte
- func (b *BlockV03) IsVotedLeaderByComplain(leader module.Address) bool
- func (b *BlockV03) LeaderVotes() *LeaderVoteList
- func (b *BlockV03) LogsBloom() module.LogsBloom
- func (b *BlockV03) NextLeader() common.Address
- func (b *BlockV03) NextRepsHash() []byte
- func (b *BlockV03) NextValidators() *RepsList
- func (b *BlockV03) NormalTransactions() []module.Transaction
- func (b *BlockV03) PrevID() []byte
- func (b *BlockV03) PrevVotes() *BlockVoteList
- func (b *BlockV03) Proposer() module.Address
- func (b *BlockV03) ReceiptsHash() []byte
- func (b *BlockV03) RepsChanged() bool
- func (b *BlockV03) RepsHash() []byte
- func (b *BlockV03) Signature() common.Signature
- func (b *BlockV03) StateHash() []byte
- func (b *BlockV03) Timestamp() int64
- func (b *BlockV03) ToJSON(rcpVersion module.JSONVersion) (interface{}, error)
- func (b *BlockV03) TransactionRoot() []byte
- func (b *BlockV03) Validators() *RepsList
- func (b *BlockV03) Verify(prev Block) error
- func (b *BlockV03) Version() string
- func (b *BlockV03) Votes() *BlockVoteList
- type BlockV03JSON
- type BlockVote
- type BlockVoteJSON
- type BlockVoteJSONIndividual
- type BlockVoteJSONSharable
- type BlockVoteList
- func (s *BlockVoteList) Add(idx int, vote interface{}) bool
- func (s *BlockVoteList) Bytes() []byte
- func (s *BlockVoteList) CheckVoters(reps *RepsList, voted []bool) error
- func (s *BlockVoteList) CommitVoteSet() module.CommitVoteSet
- func (s *BlockVoteList) Hash() []byte
- func (s *BlockVoteList) MarshalJSON() ([]byte, error)
- func (s *BlockVoteList) Quorum() []byte
- func (s *BlockVoteList) RLPDecodeSelf(d codec.Decoder) error
- func (s *BlockVoteList) RLPEncodeSelf(e codec.Encoder) error
- func (s *BlockVoteList) Root() []byte
- func (s *BlockVoteList) String() string
- func (s *BlockVoteList) Timestamp() int64
- func (s *BlockVoteList) UnmarshalJSON(b []byte) error
- func (s *BlockVoteList) Verify(reps *RepsList) error
- func (s *BlockVoteList) VerifyBlock(block module.BlockData, validators module.ValidatorList) ([]bool, error)
- type LeaderVote
- type LeaderVoteIndividual
- type LeaderVoteList
- func (s *LeaderVoteList) Bytes() []byte
- func (s *LeaderVoteList) Hash() []byte
- func (s *LeaderVoteList) MarshalJSON() ([]byte, error)
- func (s *LeaderVoteList) RLPDecodeSelf(d codec.Decoder) error
- func (s *LeaderVoteList) RLPEncodeSelf(e codec.Encoder) error
- func (s *LeaderVoteList) Root() []byte
- func (s *LeaderVoteList) UnmarshalJSON(b []byte) error
- func (s *LeaderVoteList) Verify(reps *RepsList) error
- type LeaderVoteSharable
- type RepJSON
- type RepsList
- func (l *RepsList) Get(i int) module.Address
- func (l *RepsList) GetNextOf(addr module.Address) module.Address
- func (l *RepsList) GetValidatorList(dbase db.Database) (module.ValidatorList, error)
- func (l *RepsList) Hash() []byte
- func (l *RepsList) Size() int
- func (l *RepsList) ToJSON(version module.JSONVersion) (interface{}, error)
- func (l *RepsList) UnmarshalJSON(bs []byte) error
- type Store
- type Transaction
Constants ¶
View Source
const ( Version01a = "0.1a" Version03 = "0.3" Version04 = "0.4" Version05 = "0.5" )
Variables ¶
This section is empty.
Functions ¶
func CalcMerkleRootOfReceiptList ¶
func CalcMerkleRootOfReceiptList( receipts module.ReceiptList, txs module.TransactionList, height int64, ) []byte
func CalcOriginalReceiptHash ¶
func TransactionRootForBlockV03 ¶ added in v0.9.10
func TransactionRootForBlockV03(txs []Transaction) []byte
Types ¶
type Block ¶
type Block interface { Version() string ID() []byte Height() int64 Timestamp() int64 PrevID() []byte Votes() *BlockVoteList Proposer() module.Address Validators() *RepsList NextValidators() *RepsList NormalTransactions() []module.Transaction LogsBloom() module.LogsBloom Verify(prev Block) error ToJSON(version module.JSONVersion) (interface{}, error) TransactionRoot() []byte }
func NewBlockV01a ¶ added in v0.9.10
func NewBlockV01a(jsn *BlockV01aJSON) Block
func NewBlockV03 ¶ added in v0.9.10
func NewBlockV03(jso *BlockV03JSON, lc Store) (Block, error)
func ParseBlockV01a ¶
type BlockV01a ¶
type BlockV01a struct { *BlockV01aJSON // contains filtered or unexported fields }
func (*BlockV01a) NextValidators ¶
func (*BlockV01a) NormalTransactions ¶
func (b *BlockV01a) NormalTransactions() []module.Transaction
func (*BlockV01a) ToJSON ¶
func (b *BlockV01a) ToJSON(version module.JSONVersion) (interface{}, error)
func (*BlockV01a) TransactionRoot ¶ added in v0.9.10
func (*BlockV01a) Validators ¶
func (*BlockV01a) Votes ¶
func (b *BlockV01a) Votes() *BlockVoteList
type BlockV01aJSON ¶ added in v0.9.10
type BlockV01aJSON struct { Version string `json:"version"` PrevBlockHash common.RawHexBytes `json:"prev_block_hash,omitempty"` MerkleTreeRootHash common.RawHexBytes `json:"merkle_tree_root_hash"` Transactions []Transaction `json:"confirmed_transaction_list,omitempty"` BlockHash common.RawHexBytes `json:"block_hash"` Height int64 `json:"height"` PeerID *common.Address `json:"peer_id"` TimeStamp uint64 `json:"time_stamp"` Signature common.Signature `json:"signature,omitempty"` }
func (*BlockV01aJSON) CalcHash ¶ added in v0.9.10
func (b *BlockV01aJSON) CalcHash() []byte
type BlockV03 ¶
type BlockV03 struct {
// contains filtered or unexported fields
}
func (*BlockV03) GetNextLeader ¶ added in v0.9.7
func (*BlockV03) IsVotedLeaderByComplain ¶ added in v0.9.8
func (*BlockV03) LeaderVotes ¶ added in v0.9.7
func (b *BlockV03) LeaderVotes() *LeaderVoteList
func (*BlockV03) NextLeader ¶ added in v0.9.7
func (*BlockV03) NextRepsHash ¶ added in v0.9.8
func (*BlockV03) NextValidators ¶
func (*BlockV03) NormalTransactions ¶
func (b *BlockV03) NormalTransactions() []module.Transaction
func (*BlockV03) PrevVotes ¶ added in v0.9.7
func (b *BlockV03) PrevVotes() *BlockVoteList
func (*BlockV03) ReceiptsHash ¶
func (*BlockV03) RepsChanged ¶ added in v0.9.10
func (*BlockV03) ToJSON ¶
func (b *BlockV03) ToJSON(rcpVersion module.JSONVersion) (interface{}, error)
func (*BlockV03) TransactionRoot ¶ added in v0.9.10
func (*BlockV03) Validators ¶
func (*BlockV03) Votes ¶
func (b *BlockV03) Votes() *BlockVoteList
type BlockV03JSON ¶
type BlockV03JSON struct { Hash common.HexBytes `json:"hash"` Version string `json:"version"` PrevHash common.HexHash `json:"prevHash"` TransactionsHash common.HexHash `json:"transactionsHash"` StateHash common.HexHash `json:"stateHash"` ReceiptsHash common.HexHash `json:"receiptsHash"` RepsHash common.HexHash `json:"repsHash"` NextRepsHash common.HexHash `json:"nextRepsHash"` LeaderVotesHash common.HexHash `json:"leaderVotesHash"` PrevVotesHash common.HexHash `json:"prevVotesHash"` LogsBloom txresult.LogsBloom `json:"logsBloom"` Timestamp common.HexInt64 `json:"timestamp"` Transactions []Transaction `json:"transactions"` LeaderVotes *LeaderVoteList `json:"leaderVotes"` PrevVotes *BlockVoteList `json:"prevVotes"` Height common.HexInt64 `json:"height"` Leader common.Address `json:"leader"` NextLeader common.Address `json:"nextLeader"` Signature common.Signature `json:"signature"` }
func (*BlockV03JSON) CalcHash ¶ added in v0.9.10
func (jsn *BlockV03JSON) CalcHash() []byte
type BlockVote ¶
type BlockVote struct {
// contains filtered or unexported fields
}
func NewBlockVote ¶ added in v0.9.10
func (*BlockVote) MarshalJSON ¶ added in v0.9.7
func (*BlockVote) UnmarshalJSON ¶
type BlockVoteJSON ¶
type BlockVoteJSON struct { BlockVoteJSONSharable BlockVoteJSONIndividual }
type BlockVoteJSONIndividual ¶ added in v0.9.7
type BlockVoteJSONSharable ¶ added in v0.9.7
type BlockVoteJSONSharable struct { BlockHeight common.HexInt64 `json:"blockHeight"` Round_ *int `json:"round_,omitempty"` Round *common.HexInt64 `json:"round,omitempty"` BlockHash common.HexHash `json:"blockHash"` }
func (*BlockVoteJSONSharable) Equal ¶ added in v0.9.7
func (s *BlockVoteJSONSharable) Equal(s2 *BlockVoteJSONSharable) bool
type BlockVoteList ¶
type BlockVoteList struct {
// contains filtered or unexported fields
}
func NewBlockVoteList ¶ added in v0.9.10
func NewBlockVoteList(votes ...*BlockVote) *BlockVoteList
func NewBlockVotesFromBytes ¶ added in v0.9.10
func NewBlockVotesFromBytes(bs []byte) (*BlockVoteList, error)
func (*BlockVoteList) Add ¶ added in v0.9.10
func (s *BlockVoteList) Add(idx int, vote interface{}) bool
func (*BlockVoteList) Bytes ¶ added in v0.9.8
func (s *BlockVoteList) Bytes() []byte
func (*BlockVoteList) CheckVoters ¶
func (s *BlockVoteList) CheckVoters(reps *RepsList, voted []bool) error
func (*BlockVoteList) CommitVoteSet ¶ added in v0.9.10
func (s *BlockVoteList) CommitVoteSet() module.CommitVoteSet
func (*BlockVoteList) Hash ¶
func (s *BlockVoteList) Hash() []byte
func (*BlockVoteList) MarshalJSON ¶
func (s *BlockVoteList) MarshalJSON() ([]byte, error)
func (*BlockVoteList) Quorum ¶
func (s *BlockVoteList) Quorum() []byte
func (*BlockVoteList) RLPDecodeSelf ¶ added in v0.9.7
func (s *BlockVoteList) RLPDecodeSelf(d codec.Decoder) error
func (*BlockVoteList) RLPEncodeSelf ¶ added in v0.9.7
func (s *BlockVoteList) RLPEncodeSelf(e codec.Encoder) error
func (*BlockVoteList) Root ¶ added in v0.9.7
func (s *BlockVoteList) Root() []byte
func (*BlockVoteList) String ¶ added in v0.9.10
func (s *BlockVoteList) String() string
func (*BlockVoteList) Timestamp ¶ added in v0.9.10
func (s *BlockVoteList) Timestamp() int64
func (*BlockVoteList) UnmarshalJSON ¶
func (s *BlockVoteList) UnmarshalJSON(b []byte) error
func (*BlockVoteList) Verify ¶
func (s *BlockVoteList) Verify(reps *RepsList) error
func (*BlockVoteList) VerifyBlock ¶ added in v0.9.8
func (s *BlockVoteList) VerifyBlock(block module.BlockData, validators module.ValidatorList) ([]bool, error)
type LeaderVote ¶
type LeaderVote struct { LeaderVoteSharable LeaderVoteIndividual // contains filtered or unexported fields }
func (*LeaderVote) GetRound ¶ added in v0.9.8
func (v *LeaderVote) GetRound() int
func (*LeaderVote) Hash ¶
func (v *LeaderVote) Hash() []byte
func (*LeaderVote) Verify ¶
func (v *LeaderVote) Verify() error
type LeaderVoteIndividual ¶ added in v0.9.7
type LeaderVoteList ¶
type LeaderVoteList struct {
// contains filtered or unexported fields
}
func (*LeaderVoteList) Bytes ¶ added in v0.9.8
func (s *LeaderVoteList) Bytes() []byte
func (*LeaderVoteList) Hash ¶
func (s *LeaderVoteList) Hash() []byte
func (*LeaderVoteList) MarshalJSON ¶
func (s *LeaderVoteList) MarshalJSON() ([]byte, error)
func (*LeaderVoteList) RLPDecodeSelf ¶ added in v0.9.7
func (s *LeaderVoteList) RLPDecodeSelf(d codec.Decoder) error
func (*LeaderVoteList) RLPEncodeSelf ¶ added in v0.9.7
func (s *LeaderVoteList) RLPEncodeSelf(e codec.Encoder) error
func (*LeaderVoteList) Root ¶ added in v0.9.7
func (s *LeaderVoteList) Root() []byte
func (*LeaderVoteList) UnmarshalJSON ¶
func (s *LeaderVoteList) UnmarshalJSON(b []byte) error
func (*LeaderVoteList) Verify ¶
func (s *LeaderVoteList) Verify(reps *RepsList) error
type LeaderVoteSharable ¶ added in v0.9.7
type LeaderVoteSharable struct { BlockHeight common.HexInt64 `json:"blockHeight"` OldLeader common.Address `json:"oldLeader"` NewLeader common.Address `json:"newLeader"` Round_ *int `json:"round_,omitempty"` Round *common.HexInt64 `json:"round,omitempty"` }
func (*LeaderVoteSharable) Equal ¶ added in v0.9.7
func (s *LeaderVoteSharable) Equal(s2 *LeaderVoteSharable) bool
type RepJSON ¶
type RepsList ¶
type RepsList struct {
// contains filtered or unexported fields
}
func NewRepsList ¶ added in v0.9.10
func (*RepsList) GetValidatorList ¶ added in v0.9.7
func (*RepsList) ToJSON ¶
func (l *RepsList) ToJSON(version module.JSONVersion) (interface{}, error)
func (*RepsList) UnmarshalJSON ¶
type Transaction ¶
type Transaction struct {
module.Transaction
}
func (*Transaction) MarshalJSON ¶
func (t *Transaction) MarshalJSON() ([]byte, error)
func (Transaction) String ¶
func (t Transaction) String() string
func (*Transaction) UnmarshalJSON ¶
func (t *Transaction) UnmarshalJSON(b []byte) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.