diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-05 17:10:24 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-05 17:10:24 +0800 |
commit | 4f0bda403ea332eeb477f8e56457423628772b19 (patch) | |
tree | a601453b364160a3af94ee324e198fcb304fc5a4 /ethpipe/config.go | |
parent | c215bbadf13ec70e4d1b65e67d4ff4568d644542 (diff) | |
download | go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.tar go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.tar.gz go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.tar.bz2 go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.tar.lz go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.tar.xz go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.tar.zst go-tangerine-4f0bda403ea332eeb477f8e56457423628772b19.zip |
Added vm options for object execution
Diffstat (limited to 'ethpipe/config.go')
-rw-r--r-- | ethpipe/config.go | 26 |
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 { |