MCPcopy Create free account
hub / github.com/CPChain/chain / Hash

Method Hash

types/transaction.go:189–196  ·  view source on GitHub ↗

Hash hashes the RLP encoding of tx. It uniquely identifies the transaction.

()

Source from the content-addressed store, hash-verified

187// Hash hashes the RLP encoding of tx.
188// It uniquely identifies the transaction.
189func (tx *Transaction) Hash() common.Hash {
190 if hash := tx.hash.Load(); hash != nil {
191 return hash.(common.Hash)
192 }
193 v := rlpHash(tx)
194 tx.hash.Store(v)
195 return v
196}
197
198// Size returns the true RLP encoded storage size of the transaction, either by
199// encoding and returning it, or returning a previsouly cached value.

Callers 3

TestTransactionJSONFunction · 0.95
TestBlockEncodingFunction · 0.95
MarshalJSONMethod · 0.95

Calls 1

rlpHashFunction · 0.70

Tested by 2

TestTransactionJSONFunction · 0.76
TestBlockEncodingFunction · 0.76