aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-09-30 18:22:42 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-09-30 23:36:00 +0800
commitbb6115b737a05e3b8bf70ff2ad74c703589627cb (patch)
tree72dc4e8df47729e283735a7a3ecb59930c66b2c5 /internal
parentb4cc8cbac4c1756c179e497c53ee83515669fe13 (diff)
downloaddexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar
dexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.gz
dexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.bz2
dexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.lz
dexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.xz
dexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.tar.zst
dexon-bb6115b737a05e3b8bf70ff2ad74c703589627cb.zip
vm, ethapi: add `limit` option to traceTransaction
that specifies the maximum number of elements in the `structLogs` output. This option is useful for debugging a transaction that involves a large number of repetition. For example, ``` debug.traceTransaction(tx, {disableStorage: true, limit: 2}) ``` shows at most the first two steps in the `structLogs`.
Diffstat (limited to 'internal')
-rw-r--r--internal/ethapi/tracer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/ethapi/tracer.go b/internal/ethapi/tracer.go
index 16ec6ebf0..c6d4f814e 100644
--- a/internal/ethapi/tracer.go
+++ b/internal/ethapi/tracer.go
@@ -278,7 +278,7 @@ 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) {
+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
@@ -301,6 +301,7 @@ func (jst *JavascriptTracer) CaptureState(env vm.Environment, pc uint64, op vm.O
jst.err = wrapError("step", err)
}
}
+ return nil
}
// GetResult calls the Javascript 'result' function and returns its value, or any accumulated error