aboutsummaryrefslogtreecommitdiffstats
path: root/xeth
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-08-30 16:19:10 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-10-04 07:13:54 +0800
commit361082ec4b942aea7c01fcb1be1782cb68b6fe3a (patch)
treed3ed9276cc61d314a6de14de1a61ea2c2d9a70b2 /xeth
parentf7a71996fbbe9cea4445600ffa3c232a6cf42803 (diff)
downloadgo-tangerine-361082ec4b942aea7c01fcb1be1782cb68b6fe3a.tar.gz
go-tangerine-361082ec4b942aea7c01fcb1be1782cb68b6fe3a.tar.zst
go-tangerine-361082ec4b942aea7c01fcb1be1782cb68b6fe3a.zip
cmd/evm, core/vm, test: refactored VM and core
* Moved `vm.Transfer` to `core` package and changed execution to call `env.Transfer` instead of `core.Transfer` directly. * core/vm: byte code VM moved to jump table instead of switch * Moved `vm.Transfer` to `core` package and changed execution to call `env.Transfer` instead of `core.Transfer` directly. * Byte code VM now shares the same code as the JITVM * Renamed Context to Contract * Changed initialiser of state transition & unexported methods * Removed the Execution object and refactor `Call`, `CallCode` & `Create` in to their own functions instead of being methods. * Removed the hard dep on the state for the VM. The VM now depends on a Database interface returned by the environment. In the process the core now depends less on the statedb by usage of the env * Moved `Log` from package `core/state` to package `core/vm`.
Diffstat (limited to 'xeth')
-rw-r--r--xeth/xeth.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 0494342a3..9d366d215 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/filters"
@@ -541,7 +542,7 @@ func (self *XEth) NewLogFilter(earliest, latest int64, skip, max int, address []
filter.SetMax(max)
filter.SetAddress(cAddress(address))
filter.SetTopics(cTopics(topics))
- filter.LogsCallback = func(logs state.Logs) {
+ filter.LogsCallback = func(logs vm.Logs) {
self.logMu.Lock()
defer self.logMu.Unlock()
@@ -580,7 +581,7 @@ func (self *XEth) NewBlockFilter() int {
id := self.filterManager.Add(filter)
self.blockQueue[id] = &hashQueue{timeout: time.Now()}
- filter.BlockCallback = func(block *types.Block, logs state.Logs) {
+ filter.BlockCallback = func(block *types.Block, logs vm.Logs) {
self.blockMu.Lock()
defer self.blockMu.Unlock()
@@ -603,7 +604,7 @@ func (self *XEth) GetFilterType(id int) byte {
return UnknownFilterTy
}
-func (self *XEth) LogFilterChanged(id int) state.Logs {
+func (self *XEth) LogFilterChanged(id int) vm.Logs {
self.logMu.Lock()
defer self.logMu.Unlock()
@@ -633,7 +634,7 @@ func (self *XEth) TransactionFilterChanged(id int) []common.Hash {
return nil
}
-func (self *XEth) Logs(id int) state.Logs {
+func (self *XEth) Logs(id int) vm.Logs {
filter := self.filterManager.Get(id)
if filter != nil {
return filter.Find()
@@ -642,7 +643,7 @@ func (self *XEth) Logs(id int) state.Logs {
return nil
}
-func (self *XEth) AllLogs(earliest, latest int64, skip, max int, address []string, topics [][]string) state.Logs {
+func (self *XEth) AllLogs(earliest, latest int64, skip, max int, address []string, topics [][]string) vm.Logs {
filter := filters.New(self.backend.ChainDb())
filter.SetEarliestBlock(earliest)
filter.SetLatestBlock(latest)
@@ -1029,19 +1030,19 @@ func (m callmsg) Data() []byte { return m.data }
type logQueue struct {
mu sync.Mutex
- logs state.Logs
+ logs vm.Logs
timeout time.Time
id int
}
-func (l *logQueue) add(logs ...*state.Log) {
+func (l *logQueue) add(logs ...*vm.Log) {
l.mu.Lock()
defer l.mu.Unlock()
l.logs = append(l.logs, logs...)
}
-func (l *logQueue) get() state.Logs {
+func (l *logQueue) get() vm.Logs {
l.mu.Lock()
defer l.mu.Unlock()