Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const BloomBitLength + const BloomByteLength + const ReceiptStatusFailed + const ReceiptStatusSuccessful + var Bloom9 = bloom9 + var EmptyHash = common.Hash + var EmptyRootHash = DeriveSha(Transactions{}) + var EmptyUncleHash = CalcUncleHash(nil) + var ErrInvalidChainId = errors.New("invalid chain id for signer") + var ErrInvalidSig = errors.New("invalid transaction v, r, s values") + var RandomAddr = common.BytesToAddress([]byte("random")) + var RandomBigInt = new(big.Int).SetBytes([]byte("dxchainRandomNumber")) + var RandomHash = common.BytesToHash([]byte("random")) + func BloomLookup(bin Bloom, topic bytesBacked) bool + func CalcUncleHash(uncles []*Header) common.Hash + func CheckEquality(t *testing.T, inputName, fieldName string, got, want interface{}) + func CheckError(t *testing.T, dataName string, got error, wants ...error) + func DeriveSha(list DerivableList) common.Hash + func LogsBloom(logs []*Log) *big.Int + func MakeRandomBlock(txLen int, parentHash common.Hash, blockNumber *big.Int) (*Block, []*Receipt) + func MakeTransactionWithReceipt(contractAddress common.Address) (*Transaction, *Receipt) + func NewCandidateTrie(root common.Hash, db *trie.Database) (*trie.Trie, error) + func NewDelegateTrie(root common.Hash, db *trie.Database) (*trie.Trie, error) + func NewEpochTrie(root common.Hash, db *trie.Database) (*trie.Trie, error) + func NewMinedCntTrie(root common.Hash, db *trie.Database) (*trie.Trie, error) + func NewVoteTrie(root common.Hash, db *trie.Database) (*trie.Trie, error) + func Number(b1, b2 *Block) bool + func Sender(signer Signer, tx *Transaction) (common.Address, error) + type AddCandidateTxData struct + Deposit common.BigInt + RewardRatio uint64 + func (data *AddCandidateTxData) DecodeRLP(s *rlp.Stream) error + func (data *AddCandidateTxData) EncodeRLP(w io.Writer) error + type Block struct + ReceivedAt time.Time + ReceivedFrom interface{} + func MakeRandomBlockForTest(txLen int, uncleLen int, blockNumber *big.Int) *Block + func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*Receipt) *Block + func NewBlockWithHeader(header *Header) *Block + func (b *Block) Bloom() Bloom + func (b *Block) Body() *Body + func (b *Block) Coinbase() common.Address + func (b *Block) DecodeRLP(s *rlp.Stream) error + func (b *Block) DeprecatedTd() *big.Int + func (b *Block) Difficulty() *big.Int + func (b *Block) DposCtx() *DposContext + 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) Hash() common.Hash + func (b *Block) Header() *Header + func (b *Block) MixDigest() common.Hash + func (b *Block) Nonce() uint64 + func (b *Block) Number() *big.Int + func (b *Block) NumberU64() uint64 + func (b *Block) ParentHash() common.Hash + func (b *Block) ReceiptHash() common.Hash + func (b *Block) Root() common.Hash + func (b *Block) SetDposCtx(dposCtx *DposContext) + func (b *Block) Size() common.StorageSize + 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) Uncles() []*Header + func (b *Block) Validator() common.Address + func (b *Block) WithBody(transactions []*Transaction, uncles []*Header) *Block + func (b *Block) WithSeal(header *Header) *Block + type BlockBy func(b1, b2 *Block) bool + func (b BlockBy) Sort(blocks Blocks) + type BlockNonce [8]byte + func EncodeNonce(i uint64) BlockNonce + func (n *BlockNonce) UnmarshalText(input []byte) error + func (n BlockNonce) MarshalText() ([]byte, error) + func (n BlockNonce) Uint64() uint64 + type Blocks []*Block + type Bloom [BloomByteLength]byte + func BytesToBloom(b []byte) Bloom + func CreateBloom(receipts Receipts) Bloom + func (b *Bloom) Add(d *big.Int) + func (b *Bloom) SetBytes(d []byte) + func (b *Bloom) UnmarshalText(input []byte) error + func (b Bloom) Big() *big.Int + func (b Bloom) Bytes() []byte + func (b Bloom) MarshalText() ([]byte, error) + func (b Bloom) Test(test *big.Int) bool + func (b Bloom) TestBytes(test []byte) bool + type Body struct + Transactions []*Transaction + Uncles []*Header + type DerivableList interface + GetRlp func(i int) []byte + Len func() int + type DposContext struct + func NewDposContext(diskdb ethdb.Database) (*DposContext, error) + func NewDposContextFromProto(diskdb ethdb.Database, ctxProto *DposContextRoot) (*DposContext, error) + func (dc *DposContext) BecomeCandidate(candidateAddr common.Address) error + func (dc *DposContext) CancelVote(delegatorAddr common.Address) error + func (dc *DposContext) CandidateTrie() *trie.Trie + func (dc *DposContext) Commit() (*DposContextRoot, error) + func (dc *DposContext) Copy() *DposContext + func (dc *DposContext) DB() *trie.Database + func (dc *DposContext) DelegateTrie() *trie.Trie + func (dc *DposContext) EpochTrie() *trie.Trie + func (dc *DposContext) GetAllDelegatorsOfCandidate(candidate common.Address) ([]common.Address, error) + func (dc *DposContext) GetCandidates() ([]common.Address, error) + func (dc *DposContext) GetMinedCnt(epoch int64, addr common.Address) int64 + func (dc *DposContext) GetValidators() ([]common.Address, error) + func (dc *DposContext) GetVotedCandidatesByAddress(delegator common.Address) ([]common.Address, error) + func (dc *DposContext) KickoutCandidate(candidateAddr common.Address) error + func (dc *DposContext) MinedCntTrie() *trie.Trie + func (dc *DposContext) RevertToSnapShot(snapshot *DposContext) + func (dc *DposContext) Root() (h common.Hash) + func (dc *DposContext) SetCandidate(candidate *trie.Trie) + func (dc *DposContext) SetDelegate(delegate *trie.Trie) + func (dc *DposContext) SetEpoch(epoch *trie.Trie) + func (dc *DposContext) SetMinedCnt(minedCnt *trie.Trie) + func (dc *DposContext) SetValidators(validators []common.Address) error + func (dc *DposContext) SetVote(vote *trie.Trie) + func (dc *DposContext) Snapshot() *DposContext + func (dc *DposContext) ToRoot() *DposContextRoot + func (dc *DposContext) Vote(delegatorAddr common.Address, candidateList []common.Address) (int, error) + func (dc *DposContext) VoteTrie() *trie.Trie + type DposContextRoot struct + CandidateRoot common.Hash + DelegateRoot common.Hash + EpochRoot common.Hash + MinedCntRoot common.Hash + VoteRoot common.Hash + func (dcp *DposContextRoot) Root() (h common.Hash) + type DxcoinCharge struct + Address common.Address + Value *big.Int + type DxcoinCollateral struct + type EIP155Signer struct + func NewEIP155Signer(chainId *big.Int) EIP155Signer + func (s EIP155Signer) Equal(s2 Signer) bool + func (s EIP155Signer) Hash(tx *Transaction) common.Hash + func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error) + func (s EIP155Signer) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big.Int, err error) + type FrontierSigner struct + func (fs FrontierSigner) Hash(tx *Transaction) common.Hash + func (fs FrontierSigner) Sender(tx *Transaction) (common.Address, error) + func (fs FrontierSigner) SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error) + func (s FrontierSigner) Equal(s2 Signer) bool + type Header struct + Bloom Bloom + Coinbase common.Address + Difficulty *big.Int + DposContext *DposContextRoot + Extra []byte + GasLimit uint64 + GasUsed uint64 + MixDigest common.Hash + Nonce BlockNonce + Number *big.Int + ParentHash common.Hash + ReceiptHash common.Hash + Root common.Hash + Time *big.Int + TxHash common.Hash + UncleHash common.Hash + Validator common.Address + func CopyHeader(h *Header) *Header + func MakeRandomHeader(parentHash common.Hash, number *big.Int) *Header + func (h *Header) Hash() common.Hash + func (h *Header) Size() common.StorageSize + func (h *Header) UnmarshalJSON(input []byte) error + func (h Header) MarshalJSON() ([]byte, error) + type HomesteadSigner struct + func (hs HomesteadSigner) Sender(tx *Transaction) (common.Address, error) + func (hs HomesteadSigner) SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error) + func (s HomesteadSigner) Equal(s2 Signer) bool + type HostAnnouncement struct + NetAddress string + Signature []byte + func (ha HostAnnouncement) RLPHash() common.Hash + type Log struct + Address common.Address + BlockHash common.Hash + BlockNumber uint64 + Data []byte + Index uint + Removed bool + Topics []common.Hash + TxHash common.Hash + TxIndex uint + func MakeLogData(blockNumber uint64, blockHash common.Hash, txHash common.Hash, txIndex uint, ...) *Log + func MakeRandomLogs(len int, blockNumber uint64, blockHash common.Hash, txHash common.Hash, ...) []*Log + func (l *Log) DecodeRLP(s *rlp.Stream) error + func (l *Log) EncodeRLP(w io.Writer) error + func (l *Log) UnmarshalJSON(input []byte) error + func (l Log) MarshalJSON() ([]byte, error) + type LogForStorage Log + func (l *LogForStorage) DecodeRLP(s *rlp.Stream) error + func (l *LogForStorage) EncodeRLP(w io.Writer) error + type Message struct + func NewMessage(from common.Address, to *common.Address, nonce uint64, amount *big.Int, ...) Message + func (m Message) CheckNonce() bool + func (m Message) Data() []byte + 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) To() *common.Address + func (m Message) Value() *big.Int + type Receipt struct + Bloom Bloom + ContractAddress common.Address + CumulativeGasUsed uint64 + GasUsed uint64 + Logs []*Log + PostState []byte + Status uint64 + TxHash common.Hash + func MakeReceiptData(txHash common.Hash, contractAddress common.Address) *Receipt + func NewReceipt(root []byte, failed bool, cumulativeGasUsed uint64) *Receipt + func (r *Receipt) DecodeRLP(s *rlp.Stream) error + func (r *Receipt) EncodeRLP(w io.Writer) error + func (r *Receipt) Size() common.StorageSize + func (r *Receipt) UnmarshalJSON(input []byte) error + func (r Receipt) MarshalJSON() ([]byte, error) + type ReceiptForStorage Receipt + func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error + func (r *ReceiptForStorage) EncodeRLP(w io.Writer) error + type Receipts []*Receipt + func MakeReceipts(len int, contractAddress common.Address) Receipts + func (r Receipts) GetRlp(i int) []byte + func (r Receipts) Len() int + type Signer interface + Equal func(Signer) bool + Hash func(tx *Transaction) common.Hash + Sender func(tx *Transaction) (common.Address, error) + SignatureValues func(tx *Transaction, sig []byte) (r, s, v *big.Int, err error) + func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer + type StorageBlock Block + func (b *StorageBlock) DecodeRLP(s *rlp.Stream) error + type StorageContract struct + ClientCollateral DxcoinCollateral + FileMerkleRoot common.Hash + FileSize uint64 + HostCollateral DxcoinCollateral + MissedProofOutputs []DxcoinCharge + RevisionNumber uint64 + Signatures [][]byte + UnlockHash common.Hash + ValidProofOutputs []DxcoinCharge + WindowEnd uint64 + WindowStart uint64 + func (sc StorageContract) ID() common.Hash + func (sc StorageContract) RLPHash() common.Hash + type StorageContractRLPHash interface + RLPHash func() common.Hash + type StorageContractRevision struct + NewFileMerkleRoot common.Hash + NewFileSize uint64 + NewMissedProofOutputs []DxcoinCharge + NewRevisionNumber uint64 + NewUnlockHash common.Hash + NewValidProofOutputs []DxcoinCharge + NewWindowEnd uint64 + NewWindowStart uint64 + ParentID common.Hash + Signatures [][]byte + UnlockConditions UnlockConditions + func (scr StorageContractRevision) RLPHash() common.Hash + type StorageProof struct + HashSet []common.Hash + ParentID common.Hash + Segment [64]byte + Signature []byte + func (sp StorageProof) RLPHash() common.Hash + type Transaction struct + func MakeRandomTransaction() *Transaction + func NewContractCreation(nonce uint64, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte) *Transaction + func NewTransaction(nonce uint64, to common.Address, amount *big.Int, gasLimit uint64, ...) *Transaction + func SignTx(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error) + func (tx *Transaction) AsMessage(s Signer) (Message, error) + func (tx *Transaction) ChainId() *big.Int + func (tx *Transaction) CheckNonce() bool + 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) Gas() uint64 + func (tx *Transaction) GasPrice() *big.Int + func (tx *Transaction) Hash() common.Hash + func (tx *Transaction) MarshalJSON() ([]byte, error) + func (tx *Transaction) Nonce() uint64 + func (tx *Transaction) Protected() 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) UnmarshalJSON(input []byte) error + func (tx *Transaction) Value() *big.Int + func (tx *Transaction) WithSignature(signer Signer, sig []byte) (*Transaction, error) + type Transactions []*Transaction + func TxDifference(a, b Transactions) Transactions + func (s Transactions) GetRlp(i int) []byte + func (s Transactions) Len() int + func (s Transactions) Swap(i, j int) + type TransactionsByPriceAndNonce struct + func NewTransactionsByPriceAndNonce(signer Signer, txs map[common.Address]Transactions) *TransactionsByPriceAndNonce + func (t *TransactionsByPriceAndNonce) Peek() *Transaction + func (t *TransactionsByPriceAndNonce) Pop() + func (t *TransactionsByPriceAndNonce) Shift() + type TxByNonce Transactions + func (s TxByNonce) Len() int + func (s TxByNonce) Less(i, j int) bool + func (s TxByNonce) Swap(i, j int) + type TxByPrice Transactions + func (s *TxByPrice) Pop() interface{} + func (s *TxByPrice) Push(x interface{}) + func (s TxByPrice) Len() int + func (s TxByPrice) Less(i, j int) bool + func (s TxByPrice) Swap(i, j int) + type UnlockConditions struct + PaymentAddresses []common.Address + SignaturesRequired uint64 + func (uc UnlockConditions) UnlockHash() common.Hash + type VoteTxData struct + Candidates []common.Address + Deposit common.BigInt + func (data *VoteTxData) DecodeRLP(s *rlp.Stream) error + func (data *VoteTxData) EncodeRLP(w io.Writer) error