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

Method updateStateObject

core/state/statedb.go:345–352  ·  view source on GitHub ↗

Setting, updating & deleting state object methods. updateStateObject writes the given object to the trie.

(stateObject *stateObject)

Source from the content-addressed store, hash-verified

343
344// updateStateObject writes the given object to the trie.
345func (self *StateDB) updateStateObject(stateObject *stateObject) {
346 addr := stateObject.Address()
347 data, err := rlp.EncodeToBytes(stateObject)
348 if err != nil {
349 panic(fmt.Errorf("can't encode object at %x: %v", addr[:], err))
350 }
351 self.setError(self.trie.TryUpdate(addr[:], data))
352}
353
354// deleteStateObject removes the given object from the state trie.
355func (self *StateDB) deleteStateObject(stateObject *stateObject) {

Callers 5

FinaliseMethod · 0.95
CommitMethod · 0.95
TestDumpMethod · 0.80
TestCopyFunction · 0.80
makeTestStateFunction · 0.80

Calls 3

setErrorMethod · 0.95
TryUpdateMethod · 0.80
AddressMethod · 0.65

Tested by 3

TestDumpMethod · 0.64
TestCopyFunction · 0.64
makeTestStateFunction · 0.64