Skip to content

Commit 9e15b7b

Browse files
committed
fixup test cases
1 parent e7fb72e commit 9e15b7b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

eth/tracers/js/tracer_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,16 @@ func TestTracer(t *testing.T) {
102102
}{
103103
{ // tests that we don't panic on bad arguments to memory access
104104
code: "{depths: [], step: function(log) { this.depths.push(log.memory.slice(-1,-2)); }, fault: function() {}, result: function() { return this.depths; }}",
105-
want: `[{},{},{}]`,
105+
want: ``,
106+
fail: "Tracer accessed out of bound memory: offset -1, end -2 at step (<eval>:1:53(15)) in server-side tracer function 'step'",
106107
}, { // tests that we don't panic on bad arguments to stack peeks
107108
code: "{depths: [], step: function(log) { this.depths.push(log.stack.peek(-1)); }, fault: function() {}, result: function() { return this.depths; }}",
108-
want: `["0","0","0"]`,
109+
want: ``,
110+
fail: "Tracer accessed out of bound stack: size 0, index -1 at step (<eval>:1:53(13)) in server-side tracer function 'step'",
109111
}, { // tests that we don't panic on bad arguments to memory getUint
110112
code: "{ depths: [], step: function(log, db) { this.depths.push(log.memory.getUint(-64));}, fault: function() {}, result: function() { return this.depths; }}",
111-
want: `["0","0","0"]`,
113+
want: ``,
114+
fail: "Tracer accessed out of bound memory: available 0, offset -64, size 32 at step (<eval>:1:58(13)) in server-side tracer function 'step'",
112115
}, { // tests some general counting
113116
code: "{count: 0, step: function() { this.count += 1; }, fault: function() {}, result: function() { return this.count; }}",
114117
want: `3`,

0 commit comments

Comments
 (0)