diff options
Diffstat (limited to 'ethstate/manifest.go')
-rw-r--r-- | ethstate/manifest.go | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/ethstate/manifest.go b/ethstate/manifest.go index 88ce673b9..604f77b89 100644 --- a/ethstate/manifest.go +++ b/ethstate/manifest.go @@ -10,38 +10,18 @@ import ( // 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 - Messages Messages } func NewManifest() *Manifest { - m := &Manifest{objectAddresses: make(map[string]bool), storageAddresses: make(map[string]map[string]bool)} + m := &Manifest{} 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) - } - - m.StorageChanges[string(stateObject.Address())][string(storageAddr)] = storage + m.Messages = nil } func (self *Manifest) AddMessage(msg *Message) *Message { @@ -61,6 +41,12 @@ type Message struct { Coinbase []byte Block []byte Number *big.Int + + ChangedAddresses [][]byte +} + +func (self *Message) AddStorageChange(addr []byte) { + self.ChangedAddresses = append(self.ChangedAddresses, addr) } func (self *Message) String() string { |