Merge pull request #2156 from ppratscher/add_replay_tx

core/vm, rpc/api: added debug_replayTransaction RPC call
This commit is contained in:
Péter Szilágyi
2016-02-03 10:34:52 +02:00
4 changed files with 147 additions and 1 deletions

View File

@ -28,6 +28,8 @@ import (
// Global Debug flag indicating Debug VM (full logging)
var Debug bool
var GenerateStructLogs bool = false
// Type is the VM type accepted by **NewVm**
type Type byte

View File

@ -367,7 +367,7 @@ func (self *Vm) RunPrecompiled(p *PrecompiledAccount, input []byte, contract *Co
// log emits a log event to the environment for each opcode encountered. This is not to be confused with the
// LOG* opcode.
func (self *Vm) log(pc uint64, op OpCode, gas, cost *big.Int, memory *Memory, stack *stack, contract *Contract, err error) {
if Debug {
if Debug || GenerateStructLogs {
mem := make([]byte, len(memory.Data()))
copy(mem, memory.Data())