Versions in this module Expand all Collapse all v0 v0.0.1 Jun 11, 2020 Changes in this version + const BloomBitLength + const BloomByteLength + const ReceiptStatusFailed + const ReceiptStatusSuccessful + var Bloom9 = bloom9 + var ErrEmptyActions = errors.New("transaction no actions") + var ErrInvalidSig = errors.New("invalid action v, r, s values") + var ErrInvalidchainID = errors.New("invalid chain id for signer") + var ErrOversizedData = errors.New("oversized data") + var ErrSigUnprotected = errors.New("signature is considered unprotected") + var ErrSignEmpty = errors.New("signature is nil") + func BloomLookup(bin Bloom, topic bytesBacked) bool + func DeriveExtensTxsMerkleRoot(txs []*Transaction) common.Hash + func DeriveReceiptsMerkleRoot(receipts []*Receipt) common.Hash + func DeriveTxsMerkleRoot(txs []*Transaction) common.Hash + func GetAuthorCache(a *Action) map[common.Name]common.Hash + func LogsBloom(logs []*Log) *big.Int + func Number(b1, b2 *Block) bool + func RecoverMultiKey(signer Signer, a *Action, tx *Transaction) ([]common.PubKey, error) + func RecoverPayerMultiKey(signer Signer, a *Action, tx *Transaction) ([]common.PubKey, error) + func RlpHash(x interface{}) (h common.Hash) + func SignActionWithMultiKey(a *Action, tx *Transaction, s Signer, parentIndex uint64, keys []*KeyPair) error + func SignPayerActionWithMultiKey(a *Action, tx *Transaction, s Signer, feePayer *FeePayer, parentIndex uint64, ...) error + func StoreAuthorCache(a *Action, authorVersion map[common.Name]common.Hash) + type AccountInfo struct + Key string + Name string + Value []byte + type AccountManagerContext struct + Action *Action + ChainConfig *params.ChainConfig + CurForkID uint64 + FromAccountExtra []common.Name + Number uint64 + type AccountTxs struct + EndHeight uint64 + IrreversibleBlockHeight uint64 + Txs []*TxHeightHashPair + type Action struct + func NewAction(actionType ActionType, from, to common.Name, nonce, assetID, gasLimit uint64, ...) *Action + func (a *Action) AssetID() uint64 + func (a *Action) ChainID() *big.Int + func (a *Action) Check(fid uint64, conf *params.ChainConfig) error + func (a *Action) Data() []byte + func (a *Action) DecodeRLP(s *rlp.Stream) error + func (a *Action) EncodeRLP(w io.Writer) error + func (a *Action) Extend() []rlp.RawValue + func (a *Action) ExtendHash() common.Hash + func (a *Action) Gas() uint64 + func (a *Action) GetFeePayerSign() []*SignData + func (a *Action) GetSign() []*SignData + func (a *Action) GetSignIndex(i uint64) []uint64 + func (a *Action) GetSignParent() uint64 + func (a *Action) Hash() common.Hash + func (a *Action) IgnoreExtend() []interface{} + func (a *Action) NewRPCAction(index uint64) *RPCAction + func (a *Action) NewRPCActionWithPayer(index uint64) *RPCActionWithPayer + func (a *Action) Nonce() uint64 + func (a *Action) Payer() common.Name + func (a *Action) PayerGasPrice() *big.Int + func (a *Action) PayerIsExist() bool + func (a *Action) PayerSignature() *Signature + func (a *Action) Recipient() common.Name + func (a *Action) Remark() []byte + func (a *Action) Sender() common.Name + func (a *Action) Type() ActionType + func (a *Action) Value() *big.Int + func (a *Action) WithParentIndex(parentIndex uint64) + func (a *Action) WithSignature(signer Signer, sig []byte, index []uint64) error + type ActionResult struct + Error string + GasAllot []*GasDistribution + GasUsed uint64 + Index uint64 + Status uint64 + func (a *ActionResult) NewRPCActionResult(aType ActionType) *RPCActionResult + func (a *ActionResult) NewRPCActionResultWithPayer(action *Action, gasPrice *big.Int) *RPCActionResultWithPayer + type ActionType uint64 + const CallContract + const CreateAccount + const CreateContract + const DeleteAccount + const DestroyAsset + const ExitTakeOver + const IncreaseAsset + const IssueAsset + const KickedCandidate + const RefundCandidate + const RegCandidate + const RemoveKickedCandidate + const SetAssetOwner + const Transfer + const UnregCandidate + const UpdateAccount + const UpdateAccountAuthor + const UpdateAsset + const UpdateAssetContract + const UpdateCandidate + const UpdateCandidatePubKey + const VoteCandidate + const WithdrawFee + type Block struct + Head *Header + Txs []*Transaction + func NewBlock(header *Header, txs []*Transaction, receipts []*Receipt) *Block + func NewBlockWithHeader(header *Header) *Block + func (b *Block) Body() *Body + func (b *Block) Check() error + func (b *Block) Coinbase() common.Name + func (b *Block) CurForkID() uint64 + func (b *Block) DecodeRLP(input []byte) error + func (b *Block) Difficulty() *big.Int + func (b *Block) EncodeRLP() ([]byte, error) + func (b *Block) ExtEncodeRLP(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) NextForkID() 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) Size() common.StorageSize + func (b *Block) Time() *big.Int + func (b *Block) Transactions() []*Transaction + func (b *Block) TxHash() common.Hash + func (b *Block) WithBody(transactions []*Transaction) *Block + func (b *Block) WithSeal(header *Header) *Block + type BlockAndResult struct + Block map[string]interface{} + DetailTxs []*DetailTx + Receipts []*Receipt + type BlockBy func(b1, b2 *Block) bool + func (bb BlockBy) Sort(blocks Blocks) + type BlockState struct + CurrentNumber uint64 + PreStatePruning bool + type Blocks []*Block + type Bloom [BloomByteLength]byte + func BytesToBloom(b []byte) Bloom + func CreateBloom(receipts []*Receipt) 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 + type DetailAction struct + InternalActions []*InternalAction + type DetailTx struct + Actions []*DetailAction + TxHash common.Hash + type FeePayer struct + GasPrice *big.Int + Payer common.Name + Sign *Signature + func (f *FeePayer) GetSignIndex(i uint64) []uint64 + func (f *FeePayer) GetSignParent() uint64 + func (f *FeePayer) WithParentIndex(parentIndex uint64) + func (f *FeePayer) WithSignature(signer Signer, sig []byte, index []uint64) error + type ForkID struct + Cur uint64 + Next uint64 + type GasDistribution struct + Account string + Gas uint64 + TypeID uint64 + type Header struct + Bloom Bloom + Coinbase common.Name + Difficulty *big.Int + Extra []byte + ForkID ForkID + GasLimit uint64 + GasUsed uint64 + Number *big.Int + ParentHash common.Hash + ProposedIrreversible uint64 + ReceiptsRoot common.Hash + Root common.Hash + Time *big.Int + TxsRoot common.Hash + func CopyHeader(h *Header) *Header + func (h *Header) CurForkID() uint64 + func (h *Header) Hash() common.Hash + func (h *Header) NextForkID() uint64 + func (h *Header) WithForkID(cur, next uint64) + type InternalAction struct + Action *RPCAction + ActionType string + Depth uint64 + Error string + GasLimit uint64 + GasUsed uint64 + type KeyPair struct + func MakeKeyPair(priv *ecdsa.PrivateKey, index []uint64) *KeyPair + type KvNode struct + Key string + Value []byte + type Log struct + ActionIndex uint + BlockHash common.Hash + BlockNumber uint64 + Data []byte + Index uint + Name common.Name + Topics []common.Hash + TxHash common.Hash + TxIndex uint + func (l *Log) NewRPCLog() *RPCLog + type OptInfo struct + Key string + Opt uint + Value []byte + type RPCAction struct + ActionIdex uint64 + Amount *big.Int + AssetID uint64 + From common.Name + GasLimit uint64 + Hash common.Hash + Nonce uint64 + Payload hexutil.Bytes + Remark hexutil.Bytes + To common.Name + Type uint64 + func (a *RPCAction) SetHash(hash common.Hash) + type RPCActionResult struct + ActionType uint64 + Error string + GasAllot []*GasDistribution + GasUsed uint64 + Index uint64 + Status uint64 + type RPCActionResultWithPayer struct + ActionType uint64 + Error string + GasAllot []*GasDistribution + GasUsed uint64 + Index uint64 + Payer common.Name + PayerGasPrice *big.Int + Status uint64 + type RPCActionWithPayer struct + ActionIdex uint64 + Amount *big.Int + AssetID uint64 + From common.Name + GasLimit uint64 + Hash common.Hash + Nonce uint64 + ParentIndex uint64 + Payer common.Name + PayerGasPrice *big.Int + PayerParentIndex uint64 + Payload hexutil.Bytes + Remark hexutil.Bytes + To common.Name + Type uint64 + func (a *RPCActionWithPayer) SetHash(hash common.Hash) + type RPCLog struct + ActionIndex uint + BlockHash common.Hash + BlockNumber uint64 + Data hexutil.Bytes + Index uint + Name common.Name + Topics []common.Hash + TxHash common.Hash + TxIndex uint + type RPCReceipt struct + ActionResults []*RPCActionResult + BlockHash common.Hash + BlockNumber uint64 + Bloom Bloom + CumulativeGasUsed uint64 + Hash common.Hash + Logs []*RPCLog + PostState hexutil.Bytes + TotalGasUsed uint64 + TransactionIndex uint64 + type RPCReceiptWithPayer struct + ActionResults []*RPCActionResultWithPayer + BlockHash common.Hash + BlockNumber uint64 + Bloom Bloom + CumulativeGasUsed uint64 + Hash common.Hash + Logs []*RPCLog + PostState hexutil.Bytes + TotalGasUsed uint64 + TransactionIndex uint64 + type RPCTransaction struct + BlockHash common.Hash + BlockNumber uint64 + GasAssetID uint64 + GasCost *big.Int + GasPrice *big.Int + Hash common.Hash + RPCActions []*RPCAction + TransactionIndex uint64 + type RPCTransactionWithPayer struct + BlockHash common.Hash + BlockNumber uint64 + GasAssetID uint64 + GasCost *big.Int + GasPrice *big.Int + Hash common.Hash + RPCActionsWithPayer []*RPCActionWithPayer + TransactionIndex uint64 + type Receipt struct + ActionResults []*ActionResult + Bloom Bloom + CumulativeGasUsed uint64 + Logs []*Log + PostState []byte + TotalGasUsed uint64 + TxHash common.Hash + func NewReceipt(root []byte, cumulativeGasUsed, totalGasUsed uint64) *Receipt + func (r *Receipt) ConsensusReceipt() *Receipt + func (r *Receipt) GetInternalTxsLog() *DetailTx + func (r *Receipt) Hash() common.Hash + func (r *Receipt) NewRPCReceipt(blockHash common.Hash, blockNumber uint64, index uint64, tx *Transaction) *RPCReceipt + func (r *Receipt) NewRPCReceiptWithPayer(blockHash common.Hash, blockNumber uint64, index uint64, tx *Transaction) *RPCReceiptWithPayer + func (r *Receipt) SetInternalTxsLog(dtxs *DetailTx) + func (r *Receipt) Size() common.StorageSize + type SignData struct + Index []uint64 + R *big.Int + S *big.Int + V *big.Int + type Signature struct + ParentIndex uint64 + SignData []*SignData + type Signer struct + func MakeSigner(chainID *big.Int) Signer + func NewSigner(chainID *big.Int) Signer + func (s Signer) Equal(s2 Signer) bool + func (s Signer) FeePayerHash(tx *Transaction) common.Hash + func (s Signer) Hash(tx *Transaction) common.Hash + func (s Signer) PayerPubKeys(a *Action, tx *Transaction) ([]common.PubKey, error) + func (s Signer) PubKeys(a *Action, tx *Transaction) ([]common.PubKey, error) + func (s Signer) SignatureValues(sig []byte) (R, S, V *big.Int, err error) + type SnapshotBlock struct + BlockHash common.Hash + Number uint64 + type SnapshotInfo struct + Root common.Hash + type StateOut struct + Changes []*OptInfo + Hash common.Hash + Number uint64 + ParentHash common.Hash + ReadSet []*KvNode + Reverts []*OptInfo + type Transaction struct + func NewTransaction(assetID uint64, price *big.Int, actions ...*Action) *Transaction + func TxDifference(a, b []*Transaction) []*Transaction + func (tx *Transaction) Check(fid uint64, conf *params.ChainConfig) error + func (tx *Transaction) Cost() *big.Int + func (tx *Transaction) DecodeRLP(s *rlp.Stream) error + func (tx *Transaction) EncodeRLP(w io.Writer) error + func (tx *Transaction) ExtensHash() common.Hash + func (tx *Transaction) GasAssetID() uint64 + func (tx *Transaction) GasPrice() *big.Int + func (tx *Transaction) GetActions() []*Action + func (tx *Transaction) Hash() common.Hash + func (tx *Transaction) NewRPCTransaction(blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransaction + func (tx *Transaction) NewRPCTransactionWithPayer(blockHash common.Hash, blockNumber uint64, index uint64) *RPCTransactionWithPayer + func (tx *Transaction) PayerExist() bool + func (tx *Transaction) Size() common.StorageSize + type TransactionsByPriceAndNonce struct + func NewTransactionsByPriceAndNonce(txs map[common.Name][]*Transaction) *TransactionsByPriceAndNonce + func (t *TransactionsByPriceAndNonce) Peek() *Transaction + func (t *TransactionsByPriceAndNonce) Pop() + func (t *TransactionsByPriceAndNonce) Shift() + type TxByNonce []*Transaction + func (s TxByNonce) Len() int + func (s TxByNonce) Less(i, j int) bool + func (s TxByNonce) Swap(i, j int) + type TxByPrice []*Transaction + 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 TxHeightHashPair struct + Hash common.Hash + Height uint64