aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-15 23:12:26 +0800
committerobscuren <geffobscura@gmail.com>2014-10-15 23:12:26 +0800
commit311c6f8a3fed5ac03ee4b442fd0f420072bc41b4 (patch)
treede823080f3704d7690fd7172c9742962b66baf3a /ethstate
parent266d21209478bdb8c89e1ffb95d7f0de34635968 (diff)
downloadgo-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.tar
go-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.tar.gz
go-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.tar.bz2
go-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.tar.lz
go-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.tar.xz
go-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.tar.zst
go-tangerine-311c6f8a3fed5ac03ee4b442fd0f420072bc41b4.zip
Fixed remote Arithmetic tests
Diffstat (limited to 'ethstate')
-rw-r--r--ethstate/state.go9
-rw-r--r--ethstate/state_object.go10
2 files changed, 13 insertions, 6 deletions
diff --git a/ethstate/state.go b/ethstate/state.go
index c2486849b..b897b7ce3 100644
--- a/ethstate/state.go
+++ b/ethstate/state.go
@@ -57,6 +57,15 @@ func (self *State) GetCode(addr []byte) []byte {
return nil
}
+func (self *State) GetState(a, b []byte) []byte {
+ stateObject := self.GetStateObject(a)
+ if stateObject != nil {
+ return stateObject.GetState(b).Bytes()
+ }
+
+ return nil
+}
+
//
// Setting, updating & deleting state object methods
//
diff --git a/ethstate/state_object.go b/ethstate/state_object.go
index fe4c5f73b..4d2aae1a7 100644
--- a/ethstate/state_object.go
+++ b/ethstate/state_object.go
@@ -98,13 +98,13 @@ func (c *StateObject) SetAddr(addr []byte, value interface{}) {
}
func (self *StateObject) GetStorage(key *big.Int) *ethutil.Value {
- return self.getStorage(key.Bytes())
+ return self.GetState(key.Bytes())
}
func (self *StateObject) SetStorage(key *big.Int, value *ethutil.Value) {
- self.setStorage(key.Bytes(), value)
+ self.SetState(key.Bytes(), value)
}
-func (self *StateObject) getStorage(k []byte) *ethutil.Value {
+func (self *StateObject) GetState(k []byte) *ethutil.Value {
key := ethutil.LeftPadBytes(k, 32)
value := self.storage[string(key)]
@@ -117,11 +117,9 @@ func (self *StateObject) getStorage(k []byte) *ethutil.Value {
}
return value
-
- //return self.GetAddr(key)
}
-func (self *StateObject) setStorage(k []byte, value *ethutil.Value) {
+func (self *StateObject) SetState(k []byte, value *ethutil.Value) {
key := ethutil.LeftPadBytes(k, 32)
self.storage[string(key)] = value.Copy()
}