diff options
Diffstat (limited to 'ethstate/state.go')
-rw-r--r-- | ethstate/state.go | 45 |
1 files changed, 4 insertions, 41 deletions
diff --git a/ethstate/state.go b/ethstate/state.go index 10bcf6335..19210916e 100644 --- a/ethstate/state.go +++ b/ethstate/state.go @@ -211,50 +211,13 @@ func (self *State) Update() { } } -// Debug stuff -func (self *State) CreateOutputForDiff() { - for _, stateObject := range self.stateObjects { - stateObject.CreateOutputForDiff() - } -} - func (self *State) Manifest() *Manifest { return self.manifest } -// Object manifest -// -// The object manifest is used to keep changes to the state so we can keep track of the changes -// that occurred during a state transitioning phase. -type Manifest struct { - // XXX These will be handy in the future. Not important for now. - objectAddresses map[string]bool - storageAddresses map[string]map[string]bool - - ObjectChanges map[string]*StateObject - StorageChanges map[string]map[string]*big.Int -} - -func NewManifest() *Manifest { - m := &Manifest{objectAddresses: make(map[string]bool), storageAddresses: make(map[string]map[string]bool)} - m.Reset() - - return m -} - -func (m *Manifest) Reset() { - m.ObjectChanges = make(map[string]*StateObject) - m.StorageChanges = make(map[string]map[string]*big.Int) -} - -func (m *Manifest) AddObjectChange(stateObject *StateObject) { - m.ObjectChanges[string(stateObject.Address())] = stateObject -} - -func (m *Manifest) AddStorageChange(stateObject *StateObject, storageAddr []byte, storage *big.Int) { - if m.StorageChanges[string(stateObject.Address())] == nil { - m.StorageChanges[string(stateObject.Address())] = make(map[string]*big.Int) +// Debug stuff +func (self *State) CreateOutputForDiff() { + for _, stateObject := range self.stateObjects { + stateObject.CreateOutputForDiff() } - - m.StorageChanges[string(stateObject.Address())][string(storageAddr)] = storage } |