Documentation ¶
Overview ¶
Package chainmaker_tools defines tools for ChainMaker spv
Index ¶
- func CalcDagHash(hashType string, dag *cmCommonPb.DAG) ([]byte, error)
- func CalcRWSetRoot(hashType string, txs []*cmCommonPb.Transaction) ([]byte, error)
- func CalcTxHash(transaction *cmCommonPb.Transaction) ([]byte, error)
- func CalcTxHashWithVersion(t *cmCommonPb.Transaction, version int) ([]byte, error)
- func TxRequestConverter(request *cm_pbgo.TxRequest) (*cmCommonPb.TxRequest, error)
- func TxResponseConverter(response *cmCommonPb.TxResponse) (*cm_pbgo.TxResponse, error)
- type ContractInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcDagHash ¶
func CalcDagHash(hashType string, dag *cmCommonPb.DAG) ([]byte, error)
CalcDagHash calculate DAG hash
func CalcRWSetRoot ¶
func CalcRWSetRoot(hashType string, txs []*cmCommonPb.Transaction) ([]byte, error)
CalcRWSetRoot calculate txs' read-write set root hash, following the tx order in txs
func CalcTxHash ¶
func CalcTxHash(transaction *cmCommonPb.Transaction) ([]byte, error)
CalcTxHash calculate transaction hash
func CalcTxHashWithVersion ¶ added in v2.3.0
func CalcTxHashWithVersion(t *cmCommonPb.Transaction, version int) ([]byte, error)
CalcTxHashWithVersion use version to judge if set tx gasUsed to zero when calc tx hash
func TxRequestConverter ¶
func TxRequestConverter(request *cm_pbgo.TxRequest) (*cmCommonPb.TxRequest, error)
TxRequestConverter converts *cm_pbgo.TxRequest to *cmCommonPb.TxRequest
func TxResponseConverter ¶
func TxResponseConverter(response *cmCommonPb.TxResponse) (*cm_pbgo.TxResponse, error)
TxResponseConverter converts *cmCommonPb.TxResponse to *cm_pbgo.TxResponse
Types ¶
type ContractInfo ¶
ContractInfo contains contract data in the block
func GetContractInfoByTxPayload ¶
func GetContractInfoByTxPayload(transaction *cmCommonPb.Transaction) (*ContractInfo, error)
GetContractInfoByTxPayload parses RequestPayload in the Transaction to generate ContractInfo which contains contract name、method and params
func NewContractInfo ¶
func NewContractInfo(name, method string, params []*cmCommonPb.KeyValuePair) *ContractInfo
NewContractInfo creates ContractInfo by contract name、contract method and contract params