aboutsummaryrefslogtreecommitdiffstats
path: root/ethpipe/config.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-05 17:10:24 +0800
committerobscuren <geffobscura@gmail.com>2014-08-05 17:10:24 +0800
commit4f0bda403ea332eeb477f8e56457423628772b19 (patch)
treea601453b364160a3af94ee324e198fcb304fc5a4 /ethpipe/config.go
parentc215bbadf13ec70e4d1b65e67d4ff4568d644542 (diff)
downloaddexon-4f0bda403ea332eeb477f8e56457423628772b19.tar.gz
dexon-4f0bda403ea332eeb477f8e56457423628772b19.tar.zst
dexon-4f0bda403ea332eeb477f8e56457423628772b19.zip
Added vm options for object execution
Diffstat (limited to 'ethpipe/config.go')
-rw-r--r--ethpipe/config.go26
1 files changed, 4 insertions, 22 deletions
diff --git a/ethpipe/config.go b/ethpipe/config.go
index 764f5596f..81d36d514 100644
--- a/ethpipe/config.go
+++ b/ethpipe/config.go
@@ -1,33 +1,14 @@
package ethpipe
-import (
- "github.com/ethereum/eth-go/ethstate"
- "github.com/ethereum/eth-go/ethutil"
-)
+import "github.com/ethereum/eth-go/ethutil"
var cnfCtr = ethutil.Hex2Bytes("661005d2720d855f1d9976f88bb10c1a3398c77f")
-type object struct {
- *ethstate.StateObject
-}
-
-func (self object) StorageString(str string) *ethutil.Value {
- if ethutil.IsHex(str) {
- return self.Storage(ethutil.Hex2Bytes(str[2:]))
- } else {
- return self.Storage(ethutil.RightPadBytes([]byte(str), 32))
- }
-}
-
-func (self object) Storage(addr []byte) *ethutil.Value {
- return self.StateObject.GetStorage(ethutil.BigD(addr))
-}
-
type config struct {
pipe *Pipe
}
-func (self *config) Get(name string) object {
+func (self *config) Get(name string) *object {
configCtrl := self.pipe.World().safeGet(cnfCtr)
var addr []byte
@@ -39,7 +20,8 @@ func (self *config) Get(name string) object {
}
objectAddr := configCtrl.GetStorage(ethutil.BigD(addr))
- return object{self.pipe.World().safeGet(objectAddr.Bytes())}
+
+ return &object{self.pipe.World().safeGet(objectAddr.Bytes())}
}
func (self *config) Exist() bool {