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

Method SetState

core/state/state_object.go:186–193  ·  view source on GitHub ↗

SetState updates a value in account storage.

(db Database, key, value common.Hash)

Source from the content-addressed store, hash-verified

184
185// SetState updates a value in account storage.
186func (self *stateObject) SetState(db Database, key, value common.Hash) {
187 self.db.journal.append(storageChange{
188 account: &self.address,
189 key: key,
190 prevalue: self.GetState(db, key),
191 })
192 self.setState(key, value)
193}
194
195func (self *stateObject) setState(key, value common.Hash) {
196 self.cachedStorage[key] = value

Callers

nothing calls this directly

Calls 3

GetStateMethod · 0.95
setStateMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected