Skip to content

Commit 73d4755

Browse files
committed
add revertal to calltrace test
1 parent bd713b8 commit 73d4755

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

eth/tracers/internal/tracetest/calltrace_test.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,17 @@ type callContext struct {
104104

105105
// callTrace is the result of a callTracer run.
106106
type callTrace struct {
107-
Type string `json:"type"`
108-
From common.Address `json:"from"`
109-
To common.Address `json:"to"`
110-
Input hexutil.Bytes `json:"input"`
111-
Output hexutil.Bytes `json:"output"`
112-
Gas *hexutil.Uint64 `json:"gas,omitempty"`
113-
GasUsed *hexutil.Uint64 `json:"gasUsed,omitempty"`
114-
Value *hexutil.Big `json:"value,omitempty"`
115-
Error string `json:"error,omitempty"`
116-
Calls []callTrace `json:"calls,omitempty"`
107+
Type string `json:"type"`
108+
From common.Address `json:"from"`
109+
To common.Address `json:"to"`
110+
Input hexutil.Bytes `json:"input"`
111+
Output hexutil.Bytes `json:"output"`
112+
Gas *hexutil.Uint64 `json:"gas,omitempty"`
113+
GasUsed *hexutil.Uint64 `json:"gasUsed,omitempty"`
114+
Value *hexutil.Big `json:"value,omitempty"`
115+
Error string `json:"error,omitempty"`
116+
Revertal string `json:"revertReason,omitempty"`
117+
Calls []callTrace `json:"calls,omitempty"`
117118
}
118119

119120
// callTracerTest defines a single test to check the call tracer against.

eth/tracers/internal/tracetest/testdata/call_tracer/revert_reason.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"to": "0xf58833cf0c791881b494eb79d461e08a1f043f52",
6060
"type": "CALL",
6161
"value": "0x0",
62-
"output": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e53656c662d64656c65676174696f6e20697320646973616c6c6f7765642e0000"
62+
"output": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001e53656c662d64656c65676174696f6e20697320646973616c6c6f7765642e0000",
63+
"revertReason": "Self-delegation is disallowed."
6364
}
6465
}

0 commit comments

Comments
 (0)