aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-04 00:29:08 +0800
committerobscuren <geffobscura@gmail.com>2015-01-04 00:29:08 +0800
commitbd0c267cbe9db805b5a272d29ef8860c62ddafe5 (patch)
treea4ee41c78f56ba443e74ffc46875a88895c84647 /vm
parentca1b2a1a91401255ab4e26cec7eb575b99ecb8da (diff)
downloadgo-tangerine-bd0c267cbe9db805b5a272d29ef8860c62ddafe5.tar.gz
go-tangerine-bd0c267cbe9db805b5a272d29ef8860c62ddafe5.tar.zst
go-tangerine-bd0c267cbe9db805b5a272d29ef8860c62ddafe5.zip
Cleanup old code
Diffstat (limited to 'vm')
-rw-r--r--vm/context.go12
-rw-r--r--vm/environment.go5
-rw-r--r--vm/vm_debug.go4
3 files changed, 7 insertions, 14 deletions
diff --git a/vm/context.go b/vm/context.go
index ccbadabda..d995c92c7 100644
--- a/vm/context.go
+++ b/vm/context.go
@@ -5,7 +5,6 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/ethutil"
- "github.com/ethereum/go-ethereum/state"
)
type ContextRef interface {
@@ -15,10 +14,9 @@ type ContextRef interface {
}
type Context struct {
- caller ContextRef
- object ContextRef
- Code []byte
- message *state.Message
+ caller ContextRef
+ object ContextRef
+ Code []byte
Gas, UsedGas, Price *big.Int
@@ -26,8 +24,8 @@ type Context struct {
}
// Create a new context for the given data items
-func NewContext(msg *state.Message, caller ContextRef, object ContextRef, code []byte, gas, price *big.Int) *Context {
- c := &Context{message: msg, caller: caller, object: object, Code: code, Args: nil}
+func NewContext(caller ContextRef, object ContextRef, code []byte, gas, price *big.Int) *Context {
+ c := &Context{caller: caller, object: object, Code: code, Args: nil}
// Gas should be a pointer so it can safely be reduced through the run
// This pointer will be off the state transition
diff --git a/vm/environment.go b/vm/environment.go
index d8b1cef28..8ec13ee41 100644
--- a/vm/environment.go
+++ b/vm/environment.go
@@ -30,11 +30,6 @@ type Environment interface {
Create(me ContextRef, addr, data []byte, gas, price, value *big.Int) ([]byte, error, ContextRef)
}
-type Object interface {
- GetStorage(key *big.Int) *ethutil.Value
- SetStorage(key *big.Int, value *ethutil.Value)
-}
-
type Account interface {
SubBalance(amount *big.Int)
AddBalance(amount *big.Int)
diff --git a/vm/vm_debug.go b/vm/vm_debug.go
index baacf752b..acad9c5e7 100644
--- a/vm/vm_debug.go
+++ b/vm/vm_debug.go
@@ -47,7 +47,7 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
Timestamp: self.env.Time(), Coinbase: self.env.Coinbase(), Number: self.env.BlockNumber(),
Value: value,
})
- context := NewContext(msg, caller, me, code, gas, price)
+ context := NewContext(caller, me, code, gas, price)
if self.Recoverable {
// Recover from any require exception
@@ -617,7 +617,7 @@ func (self *DebugVm) Run(me, caller ContextRef, code []byte, value, gas, price *
val, loc := stack.Popn()
statedb.SetState(context.Address(), loc.Bytes(), val)
- context.message.AddStorageChange(loc.Bytes())
+ msg.AddStorageChange(loc.Bytes())
self.Printf(" {0x%x : 0x%x}", loc.Bytes(), val.Bytes())
case JUMP: