func (self *StateObject) GetState(key common.Hash) common.Hash { strkey := key.Str() value, exists := self.storage[strkey] if !exists { value = self.getAddr(key) if (value != common.Hash{}) { self.storage[strkey] = value } } return value }
func (self *StateObject) GetState(key common.Hash) *common.Value { strkey := key.Str() value := self.storage[strkey] if value == nil { value = self.getAddr(key) if !value.IsNil() { self.storage[strkey] = value } } return value }
// GetState returns the storage value at the given address from either the cache // or the trie func (self *StateObject) GetState(ctx context.Context, key common.Hash) (common.Hash, error) { strkey := key.Str() value, exists := self.storage[strkey] if !exists { var err error value, err = self.getAddr(ctx, key) if err != nil { return common.Hash{}, err } if (value != common.Hash{}) { self.storage[strkey] = value } } return value, nil }
func (self *StateObject) SetState(k, value common.Hash) { self.storage[k.Str()] = value self.dirty = true }
func (self *StateObject) SetState(k common.Hash, value *common.Value) { self.storage[k.Str()] = value.Copy() self.dirty = true }