diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-12-06 09:16:03 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-12-06 09:16:03 +0800 |
commit | 3fc7c978277051391f8ea7831559e9f4f83c3166 (patch) | |
tree | b11b41c1723e02adc098ddc9f4188a8bad782ed8 /internal/ethapi/tracer.go | |
parent | 7f79d249a64ee72b185ffa9a9ed78f137b7938de (diff) | |
download | go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.tar go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.tar.gz go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.tar.bz2 go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.tar.lz go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.tar.xz go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.tar.zst go-tangerine-3fc7c978277051391f8ea7831559e9f4f83c3166.zip |
core, core/vm: implemented a generic environment (#3348)
Environment is now a struct (not an interface). This
reduces a lot of tech-debt throughout the codebase where a virtual
machine environment had to be implemented in order to test or run it.
The new environment is suitable to be used en the json tests, core
consensus and light client.
Diffstat (limited to 'internal/ethapi/tracer.go')
-rw-r--r-- | internal/ethapi/tracer.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/ethapi/tracer.go b/internal/ethapi/tracer.go index 5f69826a3..6d632376b 100644 --- a/internal/ethapi/tracer.go +++ b/internal/ethapi/tracer.go @@ -124,7 +124,7 @@ func (sw *stackWrapper) toValue(vm *otto.Otto) otto.Value { // dbWrapper provides a JS wrapper around vm.Database type dbWrapper struct { - db vm.Database + db vm.StateDB } // getBalance retrieves an account's balance @@ -278,11 +278,11 @@ func wrapError(context string, err error) error { } // CaptureState implements the Tracer interface to trace a single step of VM execution -func (jst *JavascriptTracer) CaptureState(env vm.Environment, pc uint64, op vm.OpCode, gas, cost *big.Int, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, err error) error { +func (jst *JavascriptTracer) CaptureState(env *vm.Environment, pc uint64, op vm.OpCode, gas, cost *big.Int, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, err error) error { if jst.err == nil { jst.memory.memory = memory jst.stack.stack = stack - jst.db.db = env.Db() + jst.db.db = env.StateDB ocw := &opCodeWrapper{op} |