aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate/manifest.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-15 22:19:10 +0800
committerobscuren <geffobscura@gmail.com>2014-08-15 22:19:10 +0800
commit7d95e8624a3bdca4a68b2a7ff6ed133264088cc1 (patch)
tree2509b79c2b24015e339132eb80e28773df0b106e /ethstate/manifest.go
parent2b9f71c6ca45929ccef844838c633aa0af5802be (diff)
downloaddexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.tar
dexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.tar.gz
dexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.tar.bz2
dexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.tar.lz
dexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.tar.xz
dexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.tar.zst
dexon-7d95e8624a3bdca4a68b2a7ff6ed133264088cc1.zip
Added message to closure && added change addresses
Diffstat (limited to 'ethstate/manifest.go')
-rw-r--r--ethstate/manifest.go30
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 {