diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-30 16:19:10 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-10-04 07:13:54 +0800 |
commit | 361082ec4b942aea7c01fcb1be1782cb68b6fe3a (patch) | |
tree | d3ed9276cc61d314a6de14de1a61ea2c2d9a70b2 /eth | |
parent | f7a71996fbbe9cea4445600ffa3c232a6cf42803 (diff) | |
download | dexon-361082ec4b942aea7c01fcb1be1782cb68b6fe3a.tar.gz dexon-361082ec4b942aea7c01fcb1be1782cb68b6fe3a.tar.zst dexon-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 'eth')
-rw-r--r-- | eth/filters/filter.go | 16 | ||||
-rw-r--r-- | eth/filters/filter_system.go | 6 |
2 files changed, 11 insertions, 11 deletions
diff --git a/eth/filters/filter.go b/eth/filters/filter.go index b7f795607..0b4911629 100644 --- a/eth/filters/filter.go +++ b/eth/filters/filter.go @@ -21,8 +21,8 @@ import ( "github.com/ethereum/go-ethereum/common" "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" ) type AccountChange struct { @@ -39,9 +39,9 @@ type Filter struct { max int topics [][]common.Hash - BlockCallback func(*types.Block, state.Logs) + BlockCallback func(*types.Block, vm.Logs) TransactionCallback func(*types.Transaction) - LogsCallback func(state.Logs) + LogsCallback func(vm.Logs) } // Create a new filter which uses a bloom filter on blocks to figure out whether a particular block @@ -78,7 +78,7 @@ func (self *Filter) SetSkip(skip int) { } // Run filters logs with the current parameters set -func (self *Filter) Find() state.Logs { +func (self *Filter) Find() vm.Logs { earliestBlock := core.GetCurrentBlock(self.db) var earliestBlockNo uint64 = uint64(self.earliest) if self.earliest == -1 { @@ -90,7 +90,7 @@ func (self *Filter) Find() state.Logs { } var ( - logs state.Logs + logs vm.Logs block = core.GetBlockByNumber(self.db, latestBlockNo) ) @@ -112,7 +112,7 @@ done: // Get the logs of the block var ( receipts = core.GetBlockReceipts(self.db, block.Hash()) - unfiltered state.Logs + unfiltered vm.Logs ) for _, receipt := range receipts { unfiltered = append(unfiltered, receipt.Logs()...) @@ -138,8 +138,8 @@ func includes(addresses []common.Address, a common.Address) bool { return false } -func (self *Filter) FilterLogs(logs state.Logs) state.Logs { - var ret state.Logs +func (self *Filter) FilterLogs(logs vm.Logs) vm.Logs { + var ret vm.Logs // Filter the logs for interesting stuff Logs: diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 9ad73a896..1c27c7be4 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -22,7 +22,7 @@ import ( "sync" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/event" ) @@ -89,7 +89,7 @@ func (fs *FilterSystem) filterLoop() { //core.PendingBlockEvent{}, core.ChainEvent{}, core.TxPreEvent{}, - state.Logs(nil)) + vm.Logs(nil)) out: for { @@ -116,7 +116,7 @@ out: } fs.filterMu.RUnlock() - case state.Logs: + case vm.Logs: fs.filterMu.RLock() for _, filter := range fs.filters { if filter.LogsCallback != nil { |