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

Function WritePrivateStateRoot

core/private_database.go:48–50  ·  view source on GitHub ↗

WritePrivateStateRoot writes the root(hash) for private state associated with the root of Merkle tree in public chain.

(db database.Database, blockRoot, root common.Hash)

Source from the content-addressed store, hash-verified

46
47// WritePrivateStateRoot writes the root(hash) for private state associated with the root of Merkle tree in public chain.
48func WritePrivateStateRoot(db database.Database, blockRoot, root common.Hash) error {
49 return db.Put(append(privateRootPrefix, blockRoot[:]...), root[:])
50}
51
52// WritePrivateReceipt writes private receipt associated with specified transaction.
53func WritePrivateReceipt(receipt *types.Receipt, txHash common.Hash, db database.Database) error {

Callers 3

TestGetPrivateStateRootFunction · 0.85
WriteBlockWithStateMethod · 0.85

Calls 1

PutMethod · 0.65

Tested by 2

TestGetPrivateStateRootFunction · 0.68