Documentation
¶
Index ¶
- Variables
- func SignDataRequester(dr models.DataRequester, privs ...[]byte) error
- type AccountChange
- type AccountChanges
- type AccountHeight
- type AccountWithCode
- type Adminser
- type BTxs
- type BlockInfo
- type BlockMessage
- type BlockWithAuditings
- type CashedCheckExistence
- type ChainInfo
- type ChainSettings
- type Client
- func (c *Client) Account(ctx context.Context, addr common.Address) (*AccountWithCode, error)
- func (c *Client) AccountAtHeight(ctx context.Context, height common.Height, addr common.Address) (*AccountWithCode, error)
- func (c *Client) BlockHeader(ctx context.Context, height common.Height) (*BlockInfo, error)
- func (c *Client) BridgeInfoCall(ctx context.Context, requester common.Identifier, parser func([]byte) error, ...) error
- func (c *Client) BridgeInfoManage(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) CSGet(ctx context.Context, requester common.Identifier, key string) (value []byte, exist bool, err error)
- func (c *Client) CSSet(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) (bool, error)
- func (c *Client) CSSetOrUnset(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) (bool, error)
- func (c *Client) CSUnset(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) (bool, error)
- func (c *Client) Call(ctx context.Context, from, to *common.Address, nonce uint64, val *big.Int, ...) (*ReceiptWithFwds, error)
- func (c *Client) CallMS(ctx context.Context, from, to *common.Address, nonce uint64, val *big.Int, ...) (receipt *ReceiptWithFwds, err error)
- func (c *Client) CallRRInfo(ctx context.Context, requester common.Identifier, nid common.NodeID) (*models.POSInfo, bool, error)
- func (c *Client) CallRRProof(ctx context.Context, requester common.Identifier, nid common.NodeID, ...) (*models.RRProofs, bool, error)
- func (c *Client) CallbackAndCheck(ctx context.Context, sender common.Identifier, ...) (*ReceiptWithFwds, error)
- func (c *Client) ChainSetting(ctx context.Context, chainAdminPrivs [][]byte, sender common.Identifier, ...) (bool, *ReceiptWithFwds, error)
- func (c *Client) ChainStats(ctx context.Context) (*models.ChainStats, error)
- func (c *Client) ChangeRRStatus(ctx context.Context, auth common.Identifier, nid common.NodeID, ...) (bool, string, error)
- func (c *Client) Close() error
- func (c *Client) Committee(ctx context.Context, epoch common.EpochNum) ([]common.NodeID, error)
- func (c *Client) Deposit(ctx context.Context, sender common.Identifier, nodeType common.NodeType, ...) (txHash []byte, err error)
- func (c *Client) DepositAndCheck(ctx context.Context, binder common.Identifier, nodeType common.NodeType, ...) (bool, error)
- func (c *Client) Estimate(ctx context.Context, from, to *common.Address, nonce uint64, val *big.Int, ...) (*tkmrpc.RpcTx, *ReceiptWithFwds, error)
- func (c *Client) GetBTransactions(ctx context.Context, addr common.Address, start, end common.Height) (*BTxs, error)
- func (c *Client) GetBlock(ctx context.Context, height common.Height) (*BlockWithAuditings, error)
- func (c *Client) GetBlockTxs(ctx context.Context, height common.Height, page, size int32) (*BlockMessage, error)
- func (c *Client) GetBridgeInfoTo(ctx context.Context, requester common.Identifier, toChain common.ChainID, ...) (from *models.ScErcInfo, ttype models.TokenType, exist bool, err error)
- func (c *Client) GetCCCRelativeTx(ctx context.Context, cc *models.CashCheck) (hash []byte, err error)
- func (c *Client) GetCommProof(ctx context.Context, epoch common.EpochNum) (*RpcCommProof, error)
- func (c *Client) GetRRCurrent(ctx context.Context) ([]byte, error)
- func (c *Client) GetRRNodeInfo(ctx context.Context, era common.EraNum, root []byte, nodeId common.NodeID) (*RRNodeInfo, error)
- func (c *Client) GetRRProofs(ctx context.Context, rootHash common.Hash, id common.NodeIdentifier) (*models.RRProofs, error)
- func (c *Client) LastConfirmedsAt(ctx context.Context, id common.ChainID, height common.Height) (*Confirmeds, error)
- func (c *Client) ListBridgeInfosOf(ctx context.Context, requester common.Identifier, fromChain common.ChainID, ...) ([]models.ScErcInfo, error)
- func (c *Client) ListRRChanges(ctx context.Context, root []byte) (*RRChanges, error)
- func (c *Client) ListRRInfos(ctx context.Context, chainid common.ChainID, height common.Height, ...) ([]*models.RRInfo, error)
- func (c *Client) MCHAddAdmin(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHAddBootNode(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHAddDataNode(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHClrNoGas(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHCreateChain(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHDelAdmin(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHGetInfo(ctx context.Context, requester common.Identifier, id common.ChainID) (*models.MChainInfoOutput, error)
- func (c *Client) MCHRemoveBootNode(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHRemoveChain(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHRemoveDataNode(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHRestartChain(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHSetNoGas(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCHStartChain(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) MCMAddNodes(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) (delta int, err error)
- func (c *Client) MCMDelNodes(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) (delta int, err error)
- func (c *Client) MCMListNodes(ctx context.Context, requester common.Identifier) ([]common.NodeID, error)
- func (c *Client) MakeCCCExistenceProof(ctx context.Context, cc *models.CashCheck) (cce *CashedCheckExistence, err error)
- func (c *Client) MakeRpcTx(from, to *common.Address, nonce uint64, val *big.Int, input []byte, ...) (*tkmrpc.RpcTx, error)
- func (c *Client) MakeVccProof(ctx context.Context, cc *models.CashCheck) (proof string, err error)
- func (c *Client) ManageChain(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) error
- func (c *Client) ManagedComm(ctx context.Context, requester common.Identifier, adminPrivs [][]byte, ...) (delta int, err error)
- func (c *Client) NewClient() error
- func (c *Client) Nonce(ctx context.Context, addr common.Address) (uint64, error)
- func (c *Client) RRDelegate(ctx context.Context, sender common.Identifier, nonce uint64, ...) (txHash []byte, err error)
- func (c *Client) RRTxByHash(ctx context.Context, txHash []byte) (*RRTx, error)
- func (c *Client) RRUnDelegate(ctx context.Context, sender common.Identifier, nonce uint64, ...) (txHash []byte, err error)
- func (c *Client) ReceiptByHash(ctx context.Context, txHash []byte) (*TransactionReceipt, error)
- func (c *Client) RunAndCheck(ctx context.Context, txHash []byte, runErr error) (*ReceiptWithFwds, error)
- func (c *Client) SendCancelCashCheck(ctx context.Context, from common.Identifier, input []byte) (txhash []byte, err error)
- func (c *Client) SendCashCashCheck(ctx context.Context, from common.Identifier, input []byte) (txhash []byte, err error)
- func (c *Client) SendMakeVccProofTx(ctx context.Context, from common.Identifier, cc *models.CashCheck) (txhash []byte, err error)
- func (c *Client) SendTx(ctx context.Context, from common.Identifier, to *common.Address, val *big.Int, ...) (txHash []byte, err error)
- func (c *Client) SendTxMS(ctx context.Context, from common.Identifier, to *common.Address, val *big.Int, ...) (txHash []byte, err error)
- func (c *Client) SetChainSetting(ctx context.Context, privs [][]byte, sender common.Identifier, nonce uint64, ...) ([]byte, error)
- func (c *Client) SetForwarderPrivs(privs ...[]byte) error
- func (c *Client) Tokens(ctx context.Context, addr common.Address) (*big.Int, *big.Int, error)
- func (c *Client) Tx(ctx context.Context, from common.Identifier, to *common.Address, nonce uint64, ...) (txHash []byte, err error)
- func (c *Client) TxByHash(ctx context.Context, txHash []byte) (*ReceiptWithFwds, error)
- func (c *Client) TxMS(ctx context.Context, from common.Identifier, to *common.Address, nonce uint64, ...) (txHash []byte, err error)
- func (c *Client) TxProof(ctx context.Context, txHash []byte) (*TxProof, error)
- func (c *Client) TxReceipt(ctx context.Context, txHash []byte) (*ReceiptWithFwds, error)
- func (c *Client) Withdraw(ctx context.Context, sender common.Identifier, nonce uint64, ...) ([]byte, error)
- func (c *Client) WithdrawPart(ctx context.Context, sender common.Identifier, nonce uint64, ...) ([]byte, error)
- type Confirmeds
- type Contract
- type DataNodeInfo
- type MerkleItem
- type MerkleItems
- type NodeInfo
- type RRChanges
- type RRNodeChanging
- type RRNodeChangings
- type RRNodeInfo
- type RRTx
- type ReceiptWithFwds
- type RpcBlocks
- type RpcCommProof
- func (p *RpcCommProof) InfoString(level common.IndentLevel) string
- func (p *RpcCommProof) String() string
- func (p *RpcCommProof) Validate() error
- func (p *RpcCommProof) VerifyHeader(curComm *models.Committee) error
- func (p *RpcCommProof) VerifyLast(lastHeight common.Height, lastHash common.Hash) error
- type TransactionReceipt
- func (r *TransactionReceipt) Err() error
- func (r *TransactionReceipt) FullReceipt(tx *models.Transaction, pas *models.PubAndSig, blockHeight common.Height, ...) *TransactionReceipt
- func (r *TransactionReceipt) InfoString(level common.IndentLevel) string
- func (r *TransactionReceipt) Parse(outputParser func(out []byte) error, ...) error
- func (r *TransactionReceipt) PartReceipt(tx *models.Transaction, pas *models.PubAndSig, rpt *models.Receipt) *TransactionReceipt
- func (r *TransactionReceipt) Reset()
- func (r *TransactionReceipt) Revert() []byte
- func (r *TransactionReceipt) RevertError() error
- func (r *TransactionReceipt) String() string
- func (r *TransactionReceipt) Success() bool
- type TxProof
- type TxReceipts
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoReceipt = errors.New("no receipt found") ErrShouldNotBeNil = errors.New("should not be nil") ErrEstimated = errors.New("estimated") )
View Source
var (
SimpleStorage = &Contract{
Code: simpleStorageCode,
Abi: simpleStorageAbi,
}
)
Functions ¶
func SignDataRequester ¶
func SignDataRequester(dr models.DataRequester, privs ...[]byte) error
Types ¶
type AccountChange ¶
type AccountChange struct { TxHash *common.Hash `json:"txhash,omitempty"` ChainID common.ChainID `json:"chainid"` // Chain ID of from. When from is empty, it is the chain ID of delta. Height common.Height `json:"height"` // Block height of the chain in which the transaction is executed From *common.Address `json:"from"` // When the account change is delta, from is empty. Otherwise, it is the transfer out account address To *common.Address `json:"to"` // Transfer in account address Nonce uint64 `json:"nonce"` // Nonce when a transfer out account performs a transaction. This value is meaningless when the account changes to delta. Val *big.Int `json:"value"` // Account change amount Input hexutil.Bytes `json:"input"` // Transaction input information UseLocal bool `json:"uselocal"` // Is it a second currency transaction? False: base currency, true: second currency Extra hexutil.Bytes `json:"extra"` // It is currently used to save transaction types. If it does not exist, it is a normal transaction. Otherwise, it will correspond to special operations Version uint16 `json:"version"` // Version number used to distinguish different execution methods when the transaction execution is incompatible due to upgrade TimeStamp uint64 `json:"timestamp"` // The timestamp of the block in which it is located Hash []byte `json:"hash"` // transaction hash MultiSigs models.PubAndSigs `json:"multiSigs"` Sig *models.PubAndSig `json:"signature"` }
func (*AccountChange) InfoString ¶
func (c *AccountChange) InfoString(level common.IndentLevel) string
func (*AccountChange) String ¶
func (c *AccountChange) String() string
type AccountChanges ¶
type AccountChanges []*AccountChange
func (AccountChanges) InfoString ¶
func (cs AccountChanges) InfoString(level common.IndentLevel) string
type AccountHeight ¶
type AccountHeight struct { Height common.Height `json:"height"` // Current height of chain Addr common.Address `json:"address"` // Address of account Nonce uint64 `json:"nonce"` // Nonce of account Balance *big.Int `json:"balance"` // Base currency,can't be nil LocalCurrency *big.Int `json:"localCurrency"` // Second currency(if exists),could be nil StorageRoot []byte `json:"storageRoot"` // Storage root of contract,Trie(key: Hash, value: Hash) CodeHash []byte `json:"codeHash"` // Hash of contract code LongStorageRoot []byte `json:"longStorageRoot"` // System contracts are used to hold more flexible data structures, Trie(key: Hash, value: []byte) Code []byte `json:"code"` }
type AccountWithCode ¶
type AccountWithCode struct { Addr common.Address `json:"address"` // Address of account Creator *common.Address `json:"creator"` // creator of the contract Nonce uint64 `json:"nonce"` // Nonce of account Balance *big.Int `json:"balance"` // Base currency,can't be nil LocalCurrency *big.Int `json:"localCurrency"` // Second currency(if exists),could be nil StorageRoot []byte `json:"storageRoot"` // Storage root of contract,Trie(key: Hash, value: Hash) CodeHash []byte `json:"codeHash"` // Hash of contract code LongStorageRoot []byte `json:"longStorageRoot"` // System contracts are used to hold more flexible data structures, Trie(key: Hash, value: []byte) Code []byte `json:"code"` }
func (*AccountWithCode) InfoString ¶
func (c *AccountWithCode) InfoString(level common.IndentLevel) string
func (*AccountWithCode) String ¶
func (c *AccountWithCode) String() string
type BTxs ¶
type BTxs struct { Txs TxReceipts Start common.Height End common.Height }
type BlockInfo ¶
type BlockInfo struct { Hash common.Hash `json:"hash"` // Big hash, that is, big hash PreviousHash common.Hash `json:"previoushash"` // Hash of last block ChainID common.ChainID `json:"chainid"` // Current chain ID Height common.Height `json:"height"` // Block height Empty bool `json:"empty"` // Whether it is an empty block, that is, whether it is a skipped block RewardAddress common.Address `json:"rewardaddress"` // The reward address bound to the packing node (it can be any value, and the basis for issuing rewards is in the reward chain pledge contract, not depending on this value) MergedDeltaRoot *common.Hash `json:"mergeroot"` // Root hash of delta merged from other partitions BalanceDeltaRoot *common.Hash `json:"deltaroot"` // The root hash of the delta tree generated by the current block transaction of the current partition needs to be sent to other partitions StateRoot common.Hash `json:"stateroot"` // Hash root of the chain account RREra *common.EraNum `json:"rrera"` // Charging cycle of current block (main chain and reward chain) RRCurrent *common.Hash `json:"rrcurrent"` // Pledge tree root hash (main chain and reward chain) when the current block is located RRNext *common.Hash `json:"rrnext"` // Pledge tree root hash (main chain and reward chain) in the next billing cycle TxCount int `json:"txcount"` // Transaction count in block TimeStamp uint64 `json:"timestamp"` // The time stamp of Proposer proposal can not be used as a basis }
type BlockMessage ¶
type BlockMessage struct { Elections []*models.ElectMessage `json:"elections"` // start election msg AccountChanges []*AccountChange `json:"accountchanges"` // transaction }
func (*BlockMessage) InfoString ¶
func (m *BlockMessage) InfoString(level common.IndentLevel) string
func (*BlockMessage) String ¶
func (m *BlockMessage) String() string
type BlockWithAuditings ¶
type BlockWithAuditings struct { BlockHeader *models.BlockHeader BlockBody *models.BlockBody BlockPass models.PubAndSigs Auditings models.AuditorPass }
func (*BlockWithAuditings) Build ¶
func (p *BlockWithAuditings) Build(block *models.BlockEMessage, auditings models.AuditorPass) *BlockWithAuditings
func (*BlockWithAuditings) Clear ¶
func (p *BlockWithAuditings) Clear()
func (*BlockWithAuditings) InfoString ¶
func (p *BlockWithAuditings) InfoString(level common.IndentLevel) string
type CashedCheckExistence ¶
type ChainInfo ¶
type ChainInfo struct { ChainId common.ChainID `json:"chainId"` // Chain ID Mode common.ChainMode `json:"mode"` // Root?Branch?Shard? ParentId common.ChainID `json:"parent"` // Parent chain DataNodes []DataNodeInfo `json:"datanodes"` // Data node list }
information of a chain
type ChainSettings ¶
type Client ¶
type Client struct { Server string CurrentChain common.ChainID ChainInfo ChainSettings NodeConn *grpc.ClientConn NodeClient tkmrpc.NodeClient Forwarders []common.Identifier Estimating bool EstimatedRept *ReceiptWithFwds // receipt of estimate while Estimating is true Err error // error returned by estimate while Estimating is true }
func (*Client) Account ¶
func (c *Client) Account(ctx context.Context, addr common.Address) (*AccountWithCode, error)
func (*Client) AccountAtHeight ¶
func (c *Client) AccountAtHeight(ctx context.Context, height common.Height, addr common.Address) (*AccountWithCode, error)
func (*Client) BlockHeader ¶
func (*Client) BridgeInfoCall ¶ added in v0.4.0
func (*Client) BridgeInfoManage ¶ added in v0.4.0
func (*Client) CSSetOrUnset ¶
func (*Client) CallRRInfo ¶
func (*Client) CallRRProof ¶
func (*Client) CallbackAndCheck ¶
func (*Client) ChainSetting ¶
func (*Client) ChainStats ¶
func (*Client) ChangeRRStatus ¶
func (*Client) DepositAndCheck ¶
func (*Client) GetBTransactions ¶
func (*Client) GetBlock ¶
func (c *Client) GetBlock(ctx context.Context, height common.Height) (*BlockWithAuditings, error)
func (*Client) GetBlockTxs ¶
func (*Client) GetBridgeInfoTo ¶ added in v0.4.0
func (*Client) GetCCCRelativeTx ¶
func (*Client) GetCommProof ¶
func (c *Client) GetCommProof(ctx context.Context, epoch common.EpochNum) (*RpcCommProof, error)
func (*Client) GetRRNodeInfo ¶
func (*Client) GetRRProofs ¶
func (*Client) LastConfirmedsAt ¶
func (c *Client) LastConfirmedsAt(ctx context.Context, id common.ChainID, height common.Height) (*Confirmeds, error)
func (*Client) ListBridgeInfosOf ¶ added in v0.4.0
func (*Client) ListRRChanges ¶
func (*Client) ListRRInfos ¶ added in v0.4.0
func (*Client) MCHAddAdmin ¶
func (*Client) MCHAddBootNode ¶
func (*Client) MCHAddDataNode ¶
func (*Client) MCHClrNoGas ¶
func (*Client) MCHCreateChain ¶
func (*Client) MCHDelAdmin ¶
func (*Client) MCHGetInfo ¶
func (*Client) MCHRemoveBootNode ¶
func (*Client) MCHRemoveChain ¶
func (*Client) MCHRemoveDataNode ¶
func (*Client) MCHRestartChain ¶
func (*Client) MCHSetNoGas ¶
func (*Client) MCHStartChain ¶
func (*Client) MCMAddNodes ¶
func (*Client) MCMDelNodes ¶
func (*Client) MCMListNodes ¶
func (*Client) MakeCCCExistenceProof ¶
func (*Client) MakeVccProof ¶
func (*Client) ManageChain ¶
func (*Client) ManagedComm ¶
func (*Client) RRDelegate ¶
func (*Client) RRTxByHash ¶
func (*Client) RRUnDelegate ¶
func (*Client) ReceiptByHash ¶
func (*Client) RunAndCheck ¶
func (*Client) SendCancelCashCheck ¶
func (*Client) SendCashCashCheck ¶
func (*Client) SendMakeVccProofTx ¶
func (*Client) SetChainSetting ¶
func (*Client) SetForwarderPrivs ¶
func (*Client) TxReceipt ¶
根据txHash,获取交易执行回执, 第一个为回执内容 第二个为可能出现的错误,如果回执不为nil,且err不为nil,则说明执行失败,err为失败原因
type Confirmeds ¶
type Confirmeds struct { At common.Height Data models.ChainConfirmeds Root []byte }
func (*Confirmeds) InfoString ¶
func (c *Confirmeds) InfoString(level common.IndentLevel) string
type DataNodeInfo ¶
type MerkleItem ¶
func (MerkleItem) String ¶
func (m MerkleItem) String() string
type MerkleItems ¶
type MerkleItems []MerkleItem
func (MerkleItems) InfoString ¶
func (ms MerkleItems) InfoString(level common.IndentLevel) string
type NodeInfo ¶
type NodeInfo struct { NodeId common.NodeID `json:"nodeId"` Version string `json:"version"` IsDataNode bool `json:"isDataNode"` DataNodeOf common.ChainID `json:"dataNodeOf"` LastMsgTime int64 `json:"lastMsgTime"` LastEventTime int64 `json:"lastEventTime"` LastBlockTime int64 `json:"lastBlockTime"` Overflow bool `json:"overflow"` LastBlocks map[common.ChainID]common.Height `json:"lastBlocks"` OpTypes map[common.ChainID][]string `json:"opTypes"` }
type RRChanges ¶
type RRChanges struct { Era common.EraNum Root common.Hash Next common.Hash Changing common.Hash MaxDeposit *big.Int ConsDepSum *big.Int DelegatedSum *big.Int DataDepSum *big.Int Changes RRNodeChangings }
func (*RRChanges) InfoString ¶
type RRNodeChanging ¶
func (*RRNodeChanging) InfoString ¶
func (c *RRNodeChanging) InfoString(level common.IndentLevel) string
type RRNodeChangings ¶
type RRNodeChangings []*RRNodeChanging
type RRNodeInfo ¶
type RRNodeInfo struct { Era common.EraNum Root common.Hash Info *models.RRInfo Changing *models.RRC MaxDeposit *big.Int ConsDepSum, DelegatedSum, DataDepSum *big.Int }
func (*RRNodeInfo) String ¶
func (m *RRNodeInfo) String() string
type RRTx ¶
type RRTx struct { TxReceipt *TransactionReceipt RRReceipt *models.RRActReceipt }
func (*RRTx) InfoString ¶
type ReceiptWithFwds ¶
type ReceiptWithFwds struct { TransactionReceipt RealOut []byte InnerTx *models.Transaction ForwardedTimes int Estimated bool }
func NewReceiptWithForwards ¶
func NewReceiptWithForwards(rept *TransactionReceipt, estimated ...bool) (*ReceiptWithFwds, error)
func (*ReceiptWithFwds) InfoString ¶
func (r *ReceiptWithFwds) InfoString(level common.IndentLevel) string
func (*ReceiptWithFwds) String ¶
func (r *ReceiptWithFwds) String() string
type RpcBlocks ¶
type RpcBlocks struct { ChainID common.ChainID Current common.Height Blocks []*models.BlockEMessage }
func (*RpcBlocks) InfoString ¶
type RpcCommProof ¶
type RpcCommProof struct { ChainID common.ChainID // epoch where committee used Epoch common.EpochNum // block height where committee pronounced, ({Height}.EpochNum()+1)=={Epoch} Height common.Height // block hash of height HashOfHeader []byte // committee node id list of {Epoch} Committee *models.Committee // signature list of block Pass models.PubAndSigs // proof from header.ElectedNextRoot to hash of header HeaderProof trie.ProofChain // last height where committee of (Epoch-1) pronounced. ({LastHeight}.EpochNum()+2)=={Epoch} LastHeight common.Height // proof from last block hash to current block hash LastProof trie.ProofChain }
func (*RpcCommProof) InfoString ¶
func (p *RpcCommProof) InfoString(level common.IndentLevel) string
func (*RpcCommProof) String ¶
func (p *RpcCommProof) String() string
func (*RpcCommProof) Validate ¶
func (p *RpcCommProof) Validate() error
func (*RpcCommProof) VerifyHeader ¶
func (p *RpcCommProof) VerifyHeader(curComm *models.Committee) error
func (*RpcCommProof) VerifyLast ¶
func (p *RpcCommProof) VerifyLast(lastHeight common.Height, lastHash common.Hash) error
type TransactionReceipt ¶
type TransactionReceipt struct { Transaction *models.Transaction `json:"tx"` // Transaction data object Sig *models.PubAndSig `json:"signature"` // transaction signature PostState []byte `json:"root"` // It is used to record the information of transaction execution in JSON format, such as gas, cost "gas", and world state "root" after execution. Status uint64 `json:"status"` // Transaction execution status, 0: failed, 1: successful. (refers to whether the execution is abnormal) Logs []*models.Log `json:"logs" gencodec:"required"` // The log written by the contract during execution GasBonuses []*models.Bonus `json:"gasBonuses"` // gas bonuses if the tx is a contract call TxHash common.Hash `json:"transactionHash" gencodec:"required"` // Transaction Hash ContractAddress common.Address `json:"contractAddress"` // If you are creating a contract, save the address of the created contract here Out hexutil.Bytes `json:"out"` // Return value of contract execution Height common.Height `json:"blockHeight"` // The block where the transaction is packaged is high and will not be returned when calling GasUsed uint64 `json:"gasUsed"` // The gas value consumed by transaction execution is not returned in call GasFee string `json:"gasFee"` // The gas cost of transaction execution is not returned in call PostRoot []byte `json:"postroot"` // World state root after transaction execution (never return, always empty) Error string `json:"errorMsg"` // Error message in case of transaction execution failure Param []byte `json:"txParam"` // tx param generated by block proposer }
func (*TransactionReceipt) Err ¶ added in v0.1.3
func (r *TransactionReceipt) Err() error
func (*TransactionReceipt) FullReceipt ¶
func (r *TransactionReceipt) FullReceipt(tx *models.Transaction, pas *models.PubAndSig, blockHeight common.Height, rpt *models.Receipt) *TransactionReceipt
func (*TransactionReceipt) InfoString ¶
func (r *TransactionReceipt) InfoString(level common.IndentLevel) string
func (*TransactionReceipt) PartReceipt ¶
func (r *TransactionReceipt) PartReceipt(tx *models.Transaction, pas *models.PubAndSig, rpt *models.Receipt) *TransactionReceipt
func (*TransactionReceipt) Reset ¶
func (r *TransactionReceipt) Reset()
func (*TransactionReceipt) Revert ¶
func (r *TransactionReceipt) Revert() []byte
func (*TransactionReceipt) RevertError ¶
func (r *TransactionReceipt) RevertError() error
func (*TransactionReceipt) String ¶
func (r *TransactionReceipt) String() string
func (*TransactionReceipt) Success ¶ added in v0.1.3
func (r *TransactionReceipt) Success() bool
type TxProof ¶
type TxProof struct { TransactionReceipt Proof MerkleItems `json:"proof"` }
func (*TxProof) InfoString ¶
type TxReceipts ¶
type TxReceipts []*TransactionReceipt
func (TxReceipts) InfoString ¶
func (ts TxReceipts) InfoString(level common.IndentLevel) string
Click to show internal directories.
Click to hide internal directories.